<< Previous | Next >>

strtok

NEAR SYNTAX: char * _n_strtok( char * src, char * brk );

FAR SYNTAX: char far * _f_strtok( char far * src, char far * brk );

NOTE By default, strtok() is defined to _n_strtok().

Description

Scans src for tokens separated by delimiter characters specified in brk.

First call with non-null for src. Subsequent calls with null for src continue to search tokens in the string. If a token is found (i.e., delineators found), replace the first delimiter in src with a null terminator so that src points to a proper null terminated token.

Parameters

src
String to be scanned, must be in SRAM, cannot be a constant. In contrast, strings initialized when they are declared are stored in flash memory, and are treated as constants.

brk
Character delimiter.

Return value

Pointer to a token. If no delimiter (therefore no token) is found, returns null.

Library

STRING.LIB

See also

strchr, strrchr, strstr, strcspn


Dynamic C Functions << Previous | Next >> rabbit.com