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
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.
- Function Interposition in C with an example of user defined malloc()
- tellg() function in C++ with example
- wcsstr() function in C++ with example
- wcsncpy() function in C++ with example
- Buffer Overflow Attack with Example
- ftell() in C with example
- fseek() in C/C++ with example
- Writing first C++ program : Hello World example
- std::search_n with example in C++
- tellp() in file handling with c++ with example
- vector::crend() & vector::crbegin() with example
- asin() and atan() functions in C/C++ with Example
- forward_list::cend() in C++ STL with Example
- Vector removeElement() method in Java with Example
- Vector removeRange() method in Java with Example
- Vector toString() method in Java with Example
- Vector setSize() method in Java with Example
- Vector trimToSize() method in Java with Example
- ConcurrentLinkedDeque peek() method in Java with Example
- ConcurrentLinkedDeque poll() method in Java with Example