strtok()

get next token from string 

Function


SYNOPSIS

#include <string.h>

char *strtok(char *s1, const char *s2);


DESCRIPTION

The strtok() function gets the next token from string s1, where tokens are strings separated by characters from s2. To get the first token from s1, strtok() is called with s1 as its first parameter. Remaining tokens from s1 are obtained by calling strtok() with a null pointer for the first parameter. The string of delimiters, s2, can differ from call to call.

The function strtok() writes null characters into the buffer pointed to by s1.

The function strtok() is not thread-safe. See strtok_r() for a thread-safe variant.


PARAMETERS

s1 

Points to the string from which to extract tokens.

s2 

Points to a null-terminated set of delimiter characters.


RETURN VALUES

The strtok() function returns a pointer to the next token in s1. If there are no remaining tokens, it returns a null pointer.


CONFORMANCE

ANSI/ISO 9899-1990.


MULTITHREAD SAFETY LEVEL

Unsafe.


PORTING ISSUES

None.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
strsep(), strtok_r()


PTC MKS Toolkit 9.6 Documentation Build 9.