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++
- Python - Call function from another function
- How to get the function name inside a function in PHP ?
- Difference between Virtual function and Pure virtual function in C++
- What happens when a virtual function is called inside a non-virtual function in C++
- div() function in C++
- fma() function in C++
- log() function in C++
- exp() function C++
- Static Function in PHP
- How to get current function name in PHP?
- towlower() function in C/C++
- iswxdigit() function in C/C++
- strtoumax() function in C++
- wctype() 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.