如何实现 strtok() ?# Programming - 葵花宝典
s*e
1 楼
char * strtok( const char * string, const char * delimiters );
Sequentially truncate string if delimiter is found.
第一部分:
If string is not NULL, the function scans string for the first occurrence of
any character included in delimiters. If it is found, the function overwrites
the delimiter in string by a null-character and returns a pointer to the token
, i.e. the part of the scanned string previous to the delimiter.
第二部分:
After a first call to strtok, the function may be called with NULL as str
Sequentially truncate string if delimiter is found.
第一部分:
If string is not NULL, the function scans string for the first occurrence of
any character included in delimiters. If it is found, the function overwrites
the delimiter in string by a null-character and returns a pointer to the token
, i.e. the part of the scanned string previous to the delimiter.
第二部分:
After a first call to strtok, the function may be called with NULL as str