The wcspbrk() is a built-in function in C/C++ which searches for a set of wide characters present in a wide string in another wide string. It is defined within the cwchar header file of C++.
Parameters: The function has two parameters as shown below.
- dest: It specifies to the null terminated wide string to be searched.
- src: It specifies to a null terminated wide string containing the characters to search for.
Return Value: The function returns two values as follows:
- If there are one or more than one common wide characters, in dest and src, the function returns the pointer to the first wide character in dest that is also in src.
- If no wide characters is common in src & dest, a null pointer is returned.
Below programs illustrate the above function.
First occurrence in "GeeksforGeeks" is at position 0
No common wide character
- Function Overloading vs Function Overriding in C++
- What happens when a virtual function is called inside a non-virtual function in C++
- log() function in C++
- exp() function C++
- div() function in C++
- fma() function in C++
- arc function in C
- Inline function in C
- putchar() function in C
- strrev() function in C
- towlower() function in C/C++
- iswxdigit() function in C/C++
- strtoumax() function in C++
- wctype() function in C/C++
- strtoimax() function in 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.