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 in the string `ws`.
Read more about parameters of wcsrchr in parameters section
The wcsrchrfunction in C language Searches for the last occurrence of a specified wide character in a wide character string.
wcsrchr locates the last 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.
The wcsrchrfunction 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 in the string `ws`.
Searches for the last 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 last occurrence of `wc` in `ws`, or `NULL` if the character is not found.
The wcsrchr function return value :
Returns a pointer to the last occurrence of wc in ws, or NULL if wc does not occur in the string
Output
This example demonstrates the basic usage of wcsrchr to find the last occurrence of a character in a wide string.