最近要用到, 故记录一下:

#include <iostream>
#include <vector>
using namespace std;

int main()
{
	vector<int> v1, v2;
	v1.push_back(12);
	v1.push_back(34);
	
	v2 = v1;
	cout << v2[1] << endl;
	return 0;
}
      结果:34





本文转载:CSDN博客