wcschr() function in C++ searches for the first occurrence of a wide character in a wide string. The terminating null wide character is considered part of the string. Therefore, it can also be located in order to retrieve a pointer to the end of a wide string.
const wchar_t* wcschr (const wchar_t* ws, wchar_t wc) wchar_t* wcschr ( wchar_t* ws, wchar_t wc)
Parameters: The function accepts two mandatory parameters which are described below:
- ws: Pointer to the null terminated wide string to be searched for
- wc: Wide character to be located
Return values: The function returns two value as below:
- A pointer to the first occurrence of a character in a string.
- If character is not found, the function returns a null pointer.
Below programs illustrate the above function:
Program 1 :
Looking for the 'o' character in "This is some good coding"... found at 10 found at 15 found at 16 found at 20
Program 2 :
Looking for the 'g' character in "geekforgeeks"... found at 1 found at 8
- Function Overloading vs Function Overriding in C++
- What happens when a virtual function is called inside a non-virtual function in C++
- fma() function in C++
- div() function in C++
- log() function in C++
- exp() function C++
- wcsncat() function in C/C++
- Modulus function in C++ STL
- transform_inclusive_scan() function in C++
- wmemcmp() function in C/C++
- wcstoul() function in C/C++
- wmemchr() function in C/C++
- vswprintf() function in C/C++
- wcrtomb() function in C/C++
- wcstol() function in C/C++
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.