C++ vector容器的练习大全(增删查改,获取,长度,指定元素,交换,拷贝,插入,预留空间,容量是否为空,自定义等等)
#include#include#includeusingnamespacestd;voidfun01(){//vectorvec;//vectorvec(5,4);intnums[]={1,2,3,4,5,6};vectorvec(nums,nums+5);vector::iteratorit=vec.begin();while(it!=vec.end()){coutvec2(vec);cout