#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[])
{
char buf[4096], *p, *delim = ",.\n;-()& "; //注意里面有一个空格
FILE *fp;
if (argc < 2) {
printf("./a.out filename\n");
return 1;
}
fp = fopen(argv[1], "r");
while (fgets(buf, sizeof(buf), fp)) {
p = strtok(buf, delim);
if (p == NULL)
continue;
printf("%s\n", p);
while ((p = strtok(NULL, delim)) != NULL)
printf("%s\n", p);
}
fclose(fp);
return 0;
}