The wmemchr() function in C/C++ Locate character in block of wide characters. This function searches within the first num wide characters of the block pointed by ptr for the first occurrence of ch, and returns a pointer to it.
const wchar_t* wmemchr( const wchar_t* ptr, wchar_t ch, size_t num )
wchar_t* wmemchr( wchar_t* ptr, wchar_t ch, size_t num )
Parameters: The function accepts three mandatory parameters which are described below:
- ptr: specifies the pointer to the character array to be searched for.
- ch: specifies the character to be located.
- num: specifies the number of elements of type wchar_t to compare.
Return value: The function returns two value as below:
- On success, it returns a pointer to the location of character array.
- Otherwise, NULL pointer is returned.
Below programs illustrate the above function:
'o' is present in first 8 characters of "GeeksForGeeks"
Program 2 :
'p' is not present in first 3 characters of "GFG"
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Difference between user defined function and library function in C/C++
- Function Overloading vs Function Overriding in C++
- How to call some function before main() function in C++?
- How to call function within function in C or C++
- What happens when a virtual function is called inside a non-virtual function in C++
- Difference between Virtual function and Pure virtual function in C++
- div() function in C++
- arc function in C
- fma() function in C++
- log() function in C++
- exp() function C++
- imag() function in C++
- real() function in C++
- valarray log() function in C++
- valarray tan() function in C++
- valarray pow() function in C++
- map key_comp() function in C++ STL
- regex_iterator() function in C++ STL
- max() function for valarray in C++
- map rbegin() function in C++ STL
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.