strtok()函数
来源:互联网 发布:淘宝企业店铺登陆 编辑:程序博客网 时间:2024/05/22 07:40
就是函数返回第一个分隔符分隔的子串后,将第一参数设置为NULL,函数将返回剩下的子串。
下面我们来看一个例子:
int main()
{
char test1[] = "feng,ke,wei";
char *test2 = "feng,ke,wei";
char *p;
p = strtok(test1, ",");
while(p)
{
printf("%s\n", p);
p = strtok(NULL, ",");
}
return 0;
}
运行结果:
feng
ke
wei
0 0
- strtok函数
- strtok函数
- strtok() 函数
- strtok() 函数
- strtok函数
- strtok函数
- strtok函数
- strtok函数
- strtok函数
- strtok函数
- strtok函数
- strtok函数
- strtok函数
- strtok函数
- strtok()函数
- strtok函数
- strtok函数
- strtok()函数
- ...
- 在android需要大量使用xml进行网络传输时,如何用面向对象的思路降低xml的耦合性并增加重用性
- HttpClient 核心代码
- [寒江孤叶丶的Cocos2d-x之旅_15]Cocos2d-x LUA脚本中对字符串进行Base64加解密/编解码 (LUA Base64 加解密/编解码)
- UBUNTU 14.04解决sublime text 3 中文无法输入的问题
- strtok()函数
- 理解wait和notify
- Hibernate实现many-to-many的映射关系
- 自定义TabBar第一种方案
- 2014.10.10
- [寒江孤叶丶的Cocos2d-x之旅_16]Cocos2d-x LUA脚本中解析Json的方法
- (A减B)并(B减A)
- 开源网站搜集
- GCD并发的执行顺序