In my head it seems like creating (a) vector by pushing n number of elements and then appending the (a) vector to the (b) vector to make a 2D vector. I'm still a rookie at C++ so can someone suggest me a better idea
#include <iostream>
#include<vector>
using namespace std;
int main() {
int numOfIter;
vector <int> a;
vector <int> b;
cout << "enter the number of iterations -> ";
cin >> numOfIter;
for(int i = 0; i < numOfIter; i++){
a.push_back(i);
}
b.push_back(a);
for(int it : b){
cout << it;
}
return 0;
}