STL之序列式容器
来源:互联网 发布:网络语言暴力思修论文 编辑:程序博客网 时间:2024/05/29 18:07
Vector
push_back、for(std::vector<int>::iterator iter = obj.begin(); iter!=obj.end(); ++iter)
////vector
vector<int> obj;
for( int i = 0; i<5; ++i)
{
obj.push_back (i);
}
for(std::vector<int>::iterator iter = obj.begin (); iter != obj.end (); ++iter)
cout<<*iter<<endl;
for( int i = 0; i<obj.size (); i++)
cout<<obj[i]<<endl;
Deque
push_back、push_front
////deque
deque<float> obj;
for( int i = 1; i < 6; ++i)
obj.push_front ( i * 1.1);
for(int i = 0; i < obj.size (); ++i)
cout<<obj[i]<<endl;
List
push_back、front、pop_front、
list<char> obj;
for( char c = 'a'; c < 'z'; ++c)
{
obj.push_back (c);
}
while(!obj.empty ())
{
cout<<obj.front ()<<endl;
obj.pop_front();
}
///
list<char> obj;
for( char c = 'a'; c <= 'z'; ++c)
{
obj.push_back (c);
}
for(list<char>::const_iterator iter = obj.begin (); iter != obj.end (); ++iter)
cout<<*iter<<' ';
cout<<endl;
- STL之序列式容器
- STL之序列式容器
- STL源码笔记之序列式容器
- 【C++ STL】序列式容器之list
- STL序列式容器之vector
- STL之序列式容器难点分析
- STL序列式容器
- STL-序列式容器
- STL六大组件之容器篇(序列式容器vector)
- STL 序列容器之vector
- STL 序列容器之list
- STL序列容器之vector
- STL序列容器之list
- STL序列容器之deque
- C++STL之序列容器
- 【STL】序列式容器细节
- 【STL】序列式容器:vector
- 【STL】序列式容器细节
- QTableView lock QHeadView
- Android学习札记10:用SAX解析XML文件时,当标签中出现换行符时可能出现读取内容为空的解决方法
- Android深入浅出之Audio第三部分Audio Policy[1]
- 黑马程序员--c#的委托与事件
- Java中的位移运算符
- STL之序列式容器
- 第十周C++【任务3】建立一个Point(点)类,派生出一个Circle(圆)类,派生出一个Cylinder(圆柱体)类
- 苹果iTV将拿下电视高端市场 威胁传统厂商
- 如何向已经安装好的apache添加一个模块
- STL之关联式容器
- 设计模式14——Flyweight设计模式
- oracle SQL小结
- 超级多的儿童教育资料下载
- Visual Studio 远程调试设置