#include <stdio.h>
#include <string.h>
int main()
{
char s[] = "chen*yu chen cai*feng";
char *delim = "* ";
char *p = strtok(s, delim);
while(p)
{
printf("%s\n", p);
p = strtok(NULL, delim);
}
return 0;
}
1111deMacBook-Pro:dabian a1111$ gcc -g strtok.c -o strtok
1111deMacBook-Pro:dabian a1111$ ./strtok
chen
yu
chen
cai
feng
联系客服