C++ Primer 5e chapter 9.2
来源:互联网 发布:乡村旅游数据去哪里找 编辑:程序博客网 时间:2024/05/18 10:17
1、vector capacity()方法,reserve(n)方法,resize(n)方法,shrink_fit退回暂时不需要的空间;
2、string提供了和C字符串接口的许多方法,string.substr()操作,支持了多样化的操作,P323;
3、find方法,返回第一个字符的下标,rfind,最后一次出现的位置,find_first_of,find_last_of,返回字符串中人任何一个字符第一次出现的位置,最后一次出现的位置,还可以指定开始检索的位置;
4、compare函数,类似于C中的strcmp函数,
5、数值转换,int a, string b = to_string(a); stod() 字符串转换double,stoi,等等函数P328,字符串和数字的转换还是比较方便的;
6、顺序容器适配器,stack,queue,priority_queue,使得vector看起来可以像这三个一样工作,属于设计模式的一种;
7、stack<int, vector<int>>,堆栈,队列和优先队列有自己的一些操作;
0 0
- C++ Primer 5e chapter 9.2
- C++ Primer 5e chapter 5
- C++ Primer 5e chapter 1
- C++ Primer 5e chapter 2
- C++ Primer 5e chapter 3
- C++ Primer 5e chapter 4
- C++ Primer 5e chapter 6
- C++ Primer 5e chapter 7
- C++ Primer 5e chapter 8
- C++ Primer 5e chapter 9.1
- C++ Primer 5e chapter 10.1
- C++ Primer 5e chapter 10.2
- C++ Primer 5e chapter 11
- C++ Primer 5e chapter 12
- C++ Primer 5e chapter 13.1
- C++ Primer 5e chapter 13.2
- C++ Primer 5e chapter 14.1
- C++ Primer 5e chapter 14.2
- java开发个人总结笔记 小技巧
- windows C++ 进入临界区 退出临界区
- Property Animation
- 树状数组实践-HIT经理的烦恼
- Netfilter/Iptables入门
- C++ Primer 5e chapter 9.2
- linux下如何打开core dump
- Sencha Touch自定义NavigationView
- C#连接查询数据库
- Codeforces Round #286 (Div. 2) D. Mr. Kitayuta's Technology 强连通分量 有向图求环
- 遇到的几个关于路径报错的问题
- 大论文实验参考资料笔记
- 黑马程序员--正则表达式
- unity3d中,脚本的相互调用。