The wcstok() function is defined in cwchar.h header file. The wcstok() function returns the next token in a null terminated wide string. The pointer delim points to the separator characters i.e. the delimeter.
wchar_t* wcstok(wchar_t* str, const wchar_t* delim, wchar_t ** ptr);
Parameters: This method takes following paramters:
- str: It represents pointer to the null-terminated wide string to tokenize.
- delim: It represents pointer to the null terminated wide string that contains the separators.
- ptr: It represents pointer to an object of type wchar_t*, which is used by wcstok to store its internal state.
Return Value: The wcstok() function returns the pointer to the beginning of next token if there is any. Otherwise it returns zero.
Below program illustrate the above function:
A computer science portal for geeks
- Function Overloading vs Function Overriding in C++
- How to get the function name inside a function in PHP ?
- What happens when a virtual function is called inside a non-virtual function in C++
- div() function in C++
- exp() function C++
- log() function in C++
- fma() function in C++
- isfinite() function in C++
- transform_inclusive_scan() function in C++
- localtime() function in C++
- difftime() function in C++
- wcscat() function in C++
- wmemmove() function in c++
- scalbn() function in C++
- nearbyint() 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.