一 strok:从字符串中按照分隔符提取所有字串
char s[] = "水发产品,47.6,不合格,mg/kg,17-05-21 15:04;"; char *delim = ",;"; //分隔符列表 char *p;
printf("%s\n", strtok(s, delim)); while((p = strtok(NULL, delim))) //第一次给源字符串,后续给null printf("%s\n", p);