三个不常用的c语言字符串函数
来源:互联网 发布:unity3d联网游戏 编辑:程序博客网 时间:2024/05/29 10:27
stl的string功能强大,但是比较慢,在比赛中字符数组用的还是比较多,所以这里贴上三个功能强大,但是不常用的字符串函数
- #include <iostream>
- #include <algorithm>
- #include <vector>
- #include <list>
- #include <string>
- using namespace std;
- main()
- {
- char s[50]="hello world, and everything goes fine",
- d[20]=", ", t[20]="ad", *p;
- int pos;
- p = strpbrk(s,t); // find the positon of fist character in s which is also in t
- printf("%s/n/n", p);
- pos = strcspn(s,t); // find the index(int) of first character in s which is also in t
- printf("%s/n/n", s+pos);
- p = strtok(s,d); // use the characters of d to divide s
- while(p) // hint: it's not *p
- {
- puts(p);
- p = strtok(NULL,d);
- }
- system("pause");
- return 0;
- }
- 三个不常用的c语言字符串函数
- c语言的常用字符串函数
- c语言中字符串的常用函数
- C语言:字符串的常用函数 !
- C语言常用的字符串函数
- C语言 字符串常用函数
- C语言常用字符串函数
- c语言 常用字符串函数
- c语言字符串常用函数
- C语言常用字符串函数
- C语言字符串常用函数
- C语言常用的各种操作字符串的函数
- C语言字符串处理的几个常用函数
- C语言中常用的几个字符串处理函数:
- c语言中常用的字符串处理函数
- c语言中常用的字符串处理函数
- C语言字符串操作函数及常用的实现
- C语言常用字符串函数的实现一
- 伴我成长的几种利器
- Oct_32第三日: 编写用户手册
- Web GDI+显示图片
- 基于Struts2构建 WebSphere Portal上的Portlet应用
- CSDN 博客文章清单
- 三个不常用的c语言字符串函数
- ASP.NET程序中常用的三十三种代码
- 开始使用CSDN空间
- 如何学习英语?
- 运动中的摄像机检测目标
- 备份归档日志报错 ORA-19625 的解决办法
- Oct_32第四日: 如何学习一个新软件
- 为什么要有特征值和特征向量
- 一个很小的字符串类