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 : const wchar_t *
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.
2nd Parameter
Pointer to the null-terminated wide-character substring to search for in `haystack`.
Read more about parameters of wcsstr in parameters section
The wcsstrfunction in C language Finds the first occurrence of a specified wide substring in a wide character string.
wcsstr locates the first occurrence of the wide-character string pointed to by s2 (excluding the terminating null wide character) in the wide-character string pointed to by s1.
The wcsstrfunction takes 2
parameters:
•
const wchar_t * `haystack`: Pointer to the null-terminated wide-character string to be searched.
•
const wchar_t * `needle`: Pointer to the null-terminated wide-character substring to search for in `haystack`.
Finds the first occurrence of the wide-character string `needle` in the wide-character string `haystack`. Returns a pointer to the beginning of the substring, or `NULL` if the substring is not found.
The wcsstr function return value :
Returns a pointer to the located wide string, or NULL if the wide string is not found
Output
This example demonstrates the basic usage of wcsstr to find a substring within a larger string.