The wcsrchr() function is a builtin function in C/C++ which searches for the last occurrence of a wide character in a wide string. It is defined within the cwchar header file in C++.
Parameters: The function accepts two parameters which are described below.
- str: It specifies to the null terminated wide string to be searched for.
- ch: It specifies wide character to search for.
Return Value: The function returns value of two types:
- If ch is found, the function returns a pointer to the last location of ch in str.
- If not found then, a null pointer is returned.
Below programs illustrate the above function.
Last position of e in "GeeksforGeeks" is 10
o is not present in "Ishwar Gupta"
- Function Overloading vs Function Overriding in C++
- What happens when a virtual function is called inside a non-virtual function in C++
- arc function in C
- fma() function in C++
- div() function in C++
- exp() function C++
- log() function in C++
- towupper() function in C/C++
- raise() function in C++
- exp2() function in C++ STL
- iswalpha() function in C++ STL
- strtol() function in C++ STL
- feupdateenv() function in C++
- iswdigit() function in C/C++
- strtod() 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.