vector

//初始化
std::vector<int> data (10);
std::vector<int> data (10, 0);
std::vector< std::vector<int> > data(10, std::vector<int>(10, 1));

//插入指定内存的值
int* star;
int num;
std::vector<int> data;
std::copy(star, star + num, std::back_inserter(data));

//集体赋值
first.assign (7,100);

posted @ 2018-06-13 21:33  narjaja  阅读(110)  评论(0编辑  收藏  举报