How to create iterator/s for 2d vector (a vector of vectors)?
You can use auto keyword for such cases:
#include
#include
using namespace std;
int main() {
// your code goes here
vector>v;
for(int i=0;i<5;i++)
{
vector x={1,2,3,4,5};
v.push_back(x);
}
cout<<"-------------------------------------------"< y=v[i];
for(int j=0;j y=*iterator;
for(auto itr=y.begin();itr!=y.end();itr++)
{
cout<<*itr<<" ";
}
cout<