vector: Dynamic array of variables, struct or objects. Insert data at the end.
来源:互联网 发布:linux 内核编译安装 编辑:程序博客网 时间:2024/06/05 07:21
#include <iostream>
#include <vector>
#include <string>
using namespace std;
main()
{
vector<string> SS;
SS.push_back("The number is 10");
SS.push_back("The number is 20");
SS.push_back("The number is 30");
cout << "Loop by index:" << endl;
int ii;
for(ii=0; ii < SS.size(); ii++)
{
cout << SS[ii] << endl;
}
cout << endl << "Constant Iterator:" << endl;
vector<string>::const_iterator cii;
for(cii=SS.begin(); cii!=SS.end(); cii++)
{
cout << *cii << endl;
}
cout << endl << "Reverse Iterator:" << endl;
vector<string>::reverse_iterator rii;
for(rii=SS.rbegin(); rii!=SS.rend(); ++rii)
{
cout << *rii << endl;
}
cout << endl << "Sample Output:" << endl;
cout << SS.size() << endl;
cout << SS[2] << endl;
swap(SS[0], SS[2]);
cout << SS[2] << endl;
}
- vector: Dynamic array of variables, struct or objects. Insert data at the end.
- firefox报错 关于 JSON.parse: unexpected end of data at line 1 column 1 of the JSON data
- Such Summarize at the end of University .
- delete ^M at the end of line
- by the end of, at the end of , in the end , to the end 的区别与用法
- expected declaration or statement at end of input
- 错误: expected declaration or statement at end of input
- error: expected declaration or statement at end of input
- error: expected declaration or statement at end of input----solved
- expected declaration or statement at end of input
- C++ vector,Dynamic Array
- 在Internal Table 中使用AT FIRST , AT NEW, AT THE END OF , AT LAST, SUM
- Dynamic Array--Data Structure
- 关于at end of
- at end of不起作用
- warning no newline at the end of file
- warning: no newline at the end of file
- warning no newline at the end of file
- TELNET密碼嗅探
- 初入软件实施行业
- 用MySQL创建数据库和数据库表
- 在ubuntu 8.10下bochs 2.3.7源码包的编译安装
- 类依赖关系的方向
- vector: Dynamic array of variables, struct or objects. Insert data at the end.
- Eclipse取消对JSP的验证
- J2EE应用系统的MDPB开发方法
- 类加载完全揭密
- c#操作Access[上]
- WebLogic9配置域信任
- VMWare 文章收集
- GWT 学习笔记1
- SCSI和IDE硬盘