vector <int> v[6];
for(int i=0; i<v.size(); i++){
cin>>v[i];
}
I tried to change operator but it's not working.
vector <int> v[6];
for(int i=0; i<v.size(); i++){
cin>>v[i];
}
I tried to change operator but it's not working.
You actually declared a 2-d structure by using both vector
and []
together.
Either use vector<int> v(6)
or int v[6]
for a 1-d data structure.
vector <int> v[6]
defines v
as an array of vector<int>
thus v[i]
gives us a vector<int>
but since there is no overloaded operator>>
for vector<int>
we get the mentioned error.