C++ Vectors
2010-12-16 00:18 Rollen Holt 阅读(238) 评论(0) 编辑 收藏 举报Vectors contain contiguous elements stored as an array. Accessing members of a vector or appending elements can be done in constant time, whereas locating a specific value or inserting elements into the vector takes linear time.
Display all entries for C++ Vectors on one page, or view entries individually:
Vector constructors | create vectors and initialize them with some data |
Vector operators | compare, assign, and access elements of a vector |
assign | assign elements to a vector |
at | returns an element at a specific location |
back | returns a reference to last element of a vector |
begin | returns an iterator to the beginning of the vector |
capacity | returns the number of elements that the vector can hold |
clear | removes all elements from the vector |
empty | true if the vector has no elements |
end | returns an iterator just past the last element of a vector |
erase | removes elements from a vector |
front | returns a reference to the first element of a vector |
insert | inserts elements into the vector |
max_size | returns the maximum number of elements that the vector can hold |
pop_back | removes the last element of a vector |
push_back | add an element to the end of the vector |
rbegin | returns a reverse_iterator to the end of the vector |
rend | returns a reverse_iterator to the beginning of the vector |
reserve | sets the minimum capacity of the vector |
resize | change the size of the vector |
size | returns the number of items in the vector |
swap | swap the contents of this vector with another
|
==============================================================================
本博客已经废弃,不在维护。新博客地址:http://wenchao.ren
我喜欢程序员,他们单纯、固执、容易体会到成就感;面对压力,能够挑灯夜战不眠不休;面对困难,能够迎难而上挑战自我。他
们也会感到困惑与傍徨,但每个程序员的心中都有一个比尔盖茨或是乔布斯的梦想“用智慧开创属于自己的事业”。我想说的是,其
实我是一个程序员
==============================================================================
![](http://service.t.sina.com.cn/widget/qmd/1882500857/8c17d4b5/1.png)