strtok,strtok_r,strsep--extract tokens from strings Tje strsep() function was introduced as a replacement for strtok, since the latter cannot handle empty fileds. However, strtok conforms to C89/C99 and hence is more portable. #include <string.h> ch…
下面的说明摘自于最新的Linux内核2.6.29,说明了strtok()这个函数已经不再使用,由速度更快的strsep()代替 /** linux/lib/string.c** Copyright (C) 1991, 1992 Linus Torvalds*//** stupid library routines.. The optimized versions should generally be found* as inline code in <asm-xx/string.h>** T…
http://blog.sina.com.cn/s/blog_7ee076050102vamg.html http://www.cnblogs.com/lixiaohui-ambition/archive/2012/07/18/2598042.html int in=0; int j; char buffer[100]="Fred male 25,John male 62,Anna female 16"; //char buffer[100]="Fred male 2…