C Run-Time Library Reference
strtok
convert string to tokens
Synopsis
#include <string.h>
char *strtok(char *s1, const char *s2);
Description
The
function returns successive tokens from the string
strtok
each token is delimited by characters from
A call to
strtok
, where a token is a consecutive sequence of characters not in
s1
modified in place to insert a null character at the end of the token
returned. If
s1
Subsequent calls to
tokens from the same string. When the string contains no further tokens,
NULL is returned. Each new call to
string, even if
tokenized using the new delimiter characters.
Error Conditions
The
function returns a null pointer if there are no tokens remain-
strtok
ing in the string.
Example
#include <string.h>
static char str[] = "a phrase to be tested, today";
char *t;
t = strtok(str, " ");
3-140
, with
not NULL, returns a pointer to the first token in
s1
consists entirely of characters from
with
strtok
is NULL, in which case the remainder of the string is
s1
/* t points to "a"
VisualDSP++ 3.5 C/C++ Compiler and Library Manual
.
s2
s2
equal to NULL will return successive
s1
may use a new delimiter
strtok
, where
s1
.
s2
s1
, NULL is returned.
*/
for ADSP-219x DSPs
is
Need help?
Do you have a question about the VISUALDSP++ 3.5 and is the answer not in the manual?
Questions and answers