摘要: 解一道题的时候要用到字符串分割,但是c标准库里没有类似java,python中的split()函数啊,自己写的话要用到strtok()这个函数,这可真是个让人蛋疼的函数。下面说为什么。给出我的原始代码 1 #include 2 #include 3 #include 4 5 int split(char **arr,char *str,const char *del) 6 { 7 int count =0; 8 char *s = strtok(str,del); 9 while (s)10 {11 *arr++ = s;12 ... 阅读全文
posted @ 2013-07-22 13:34 lianw 阅读(429) 评论(0) 推荐(0) 编辑