【お知らせ】この部分は英語原文のみでの提供となります。何卒ご了承ください。
2.1.2.62 strtok
Contents
Description
Find the next token in a string.
Syntax
LPSTR strtok( LPCSTR lpszStrToken, LPCSTR lpcszDelimit )
Parameters
- lpszStrToken
- [input] String containing tokens to be parsed, NULL means get next token from the string that passed in on last times
- lpcszDelimit
- [input] String containing delimiters
Return
Returns a pointer to the first character of the next token.
Examples
EX1
void strtok_ex1() { char strToken[] = "This,is a.list\tof:tokens"; char strDelimiter[] = ", .\t:"; char * ptok; ptok = strtok(strToken,strDelimiter); // get first token out_str(ptok); while(ptok=strtok(NULL,strDelimiter)) // get next token out_str(ptok); }
Remark
Find the next token in a string.
See Also
Header to Include
origin.h