一、定义及初始化vector对象 定义一个含有10个元素的vector对象,所有的值都是42. 思路一:先定义一个空vector对象,然后添加元素。 vector<int> vInt; for(int i=0; i<10; i++) vInt.push_back(42)