std::wcstok - cppreference.com

##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::wcstok

From cppreference.com
< cpp‎ | string‎ | wide

Defined in header `<cwchar>` |  |
wchar_t* wcstok( wchar_t* str, const wchar_t* delim ); |  |

Finds the next token in a null-terminated wide string pointed to by `str`. The separator characters are identified by null-terminated wide string pointed to by `delim`.

If str != NULL, the function searches for the first wide character which is not separator. This character is the beginning of the token. Then the function searches for the first separator character. This character is the end of the token. Function terminates and returns NULL if end of `str` is encountered before end of the token is found. Otherwise, a pointer to end of the token is saved in a static location for subsequent invocations. This character is then replaced by a NULL-character and the function returns a pointer to the beginning of the token.

If str == NULL, the function continues from where it left in previous invocation. The behavior is the same as if the previously stored pointer is passed as str.

### [edit] Parameters

str | - | pointer to the null-terminated wide string to tokenize
delim | - | pointer to the null-terminated wide string identifying delimiters

### [edit] Return value

Pointer to the beginning of a token if the end of examined string has not been encountered. Otherwise returns NULL>

### [edit] Note

The function is not thread safe.

### [edit] Example

| This section is incomplete Reason: no example

### [edit] See also

C documentation for wcstok

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/string/wide/wcstok&oldid=51320"
Category:

- Todo no example