strtok函数
在C/C++中, strtok函数被用来拆分字符串
strtok函数原型
char *strtok( char *str, const char *delims );
char str[] = "a#abc#edfs#naway"; char delims[] = "#"; char *result = NULL; result = strtok( str, delims ); while( result != NULL ) { printf( "result is \"%s\"\n", result ); result = strtok( NULL, delims ); }