What will the following code print?
#include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<int> v1 = {1, 2, 3};
vector<int> v2;
v2 = v1;
v1[0] = 10;
cout << v2[0];
return 0;
}
Error
3
2
1
This question is part of this quiz :
C++ Vector