?? chapter6-10.cpp
字號(hào):
//文件名:CHAPTER6-10.cpp
#pragma warning(disable:4786)
#include <iostream>
#include <vector>
using namespace std ;
typedef vector<int> INTVECTOR; //定義了一個(gè)宏
void main()
{
INTVECTOR thevector; //定義一個(gè)vector變量
INTVECTOR::iterator theIterator; //采用迭代器技術(shù)
thevector.push_back(42) ; //插入一個(gè)元素值為42的元素到vector末尾中
thevector.push_back(1) ; //插入一個(gè)元素值為1的元素到vector末尾中
thevector.push_back(109) ; //插入一個(gè)元素值為109的元素到vector末尾中
thevector.pop_back(); //刪除109
cout << "thevector [ " ;
for (theIterator = thevector.begin(); theIterator != thevector.end();theIterator++) //打印結(jié)果
{ cout << *theIterator; if (theIterator != thevector.end()-1) cout << ", "; }
cout << " ]" << endl ;
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -