Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/strtok_r.html on line 1
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/strtok_r.html on line 1
Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/strtok_r.html on line 8
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/strtok_r.html on line 8
Break a string into tokens (reentrant)
#include <string.h>
char* strtok_r( char* s,
const char* sep,
char** lasts );
- s1
- NULL, or the string that you want to break into tokens;
see below.
- s2
- A set of the characters that separate the tokens.
- lasts
- The address of a pointer to a character, which the function can use
to store information necessary for it to continue scanning the same string.
libc
Use the -l c option to
qcc
to link against this library.
This library is usually included automatically.
The function strtok_r() breaks the string s into
a sequence of tokens, each of which is delimited by a character from the
string pointed to by sep.
In the first call to strtok_r(), s must point
to a null-terminated string, sep points to a
null-terminated string of separator characters, and
lasts is ignored. The strtok_r() function returns a pointer
to the first character of the first token, writes a
NULL character into s immediately following
the returned token, and updates lasts.
In subsequent calls, s must be a NULL
pointer and lasts must be unchanged from the previous call
so that subsequent calls will move through the string s,
returning successive tokens until no tokens remain. The separator
string sep may be different from call to call. When no
tokens remain in s, a NULL pointer is returned.
A pointer to the token found, or NULL if no token was found.
POSIX 1003.1 TSF
Safety: | |
Cancellation point |
No |
Interrupt handler |
Yes |
Signal handler |
Yes |
Thread |
Yes |
memchr(),
strchr(),
strcspn(),
strpbrk(),
strrchr(),
strset(),
strspn(),
strstr(),
strtok(),
wcschr(),
wcscspn(),
wcspbrk(),
wcsrchr(),
wcsspn(),
wcsstr(),
wcstok()
Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/strtok_r.html on line 153
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/strtok_r.html on line 153