C++ 的list,和vector里的函数是怎么用的

来源:百度知道 编辑:UC知道 时间:2024/05/22 04:26:31
list ,vector 里的函数是怎么用的?
是系统里自己定义的,有什么push_back()等的,请讲详细点,谢谢了

使用方法
#include <vector>
#include <list>
using namespace std;
然后直接使用

List的所有函数 全英文.....

Table 6.12. Constructors and Destructor of Lists Operation Effect
list<Elem> c Creates an empty list without any elements
list<Elem> c1(c2) Creates a copy of another list of the same type (all elements are copied)
list<Elem> c(n) Creates a list with n elements that are created by the default constructor
list<Elem> c(n,elem) Creates a list initialized with n copies of element elem
list<Elem> c (beg,end) Creates a list initialized with the elements of the range [beg,end)
c.~list<Elem>() Destroys all elements and frees the
memory

Table 6.13. Nonmodifying Operations of Lists Operation Effect
c.size() Returns the actual number of elements
c. empty () Returns whether the container is empty (equivalent to size()==0, but might be faster)