A pointer to a wide-character string, where each element is of type `wchar_t`. Used for representing text in wide-character encoding to support extended character sets.
A pointer to a read-only wide-character string, where each character is of type `wchar_t`. Used for representing text in wide-character encoding to support extended character sets, such as Unicode. The string is null-terminated, with the terminator being a `wchar_t` with value 0.
1st Parameter
Pointer to the null-terminated wide-character string to be searched.
2nd Parameter Type : wchar_t
A data type used to represent wide characters, typically supporting larger character sets such as Unicode. Its size is platform-dependent but is often 2 or 4 bytes.
2nd Parameter
The wide character to locate within the string `ws`.
Read more about parameters of wcschr in parameters section
The wcschrfunction in C language Searches for the first occurrence of a wide character in a wide character string.
wcschr locates the first occurrence of wc in the wide-character string pointed to by ws. The terminating null wide character is considered to be part of the wide-character string. If wc is L'\0', wcschr locates the terminating L'\0'.
The wcschrfunction takes 2
parameters:
•
const wchar_t * `ws`: Pointer to the null-terminated wide-character string to be searched.
•
wchar_t `wc`: The wide character to locate within the string `ws`.
Searches for the first occurrence of the wide character `wc` in the wide-character string `ws`. The null terminator is considered part of the string. Returns a pointer to the first occurrence of `wc` in `ws`, or `NULL` if the character is not found.
The wcschr function return value :
Returns a pointer to the located wide character, or NULL if the wide character does not appear in the string
Output
This example demonstrates the basic usage of wcschr to find the first occurrence of a character in a wide character string.