2D vector
#include<iostream> #include<vector> using namespace std; int fun(vector< vector<int> > vec){ for(int i=0;i<vec.size();i++){ for(int j=0;j<vec[i].size();j++){ cout<<vec[i][j]<<' '; }cout<<endl; } return 0; } int main(){ int row{10},col{10}; vector< vector<int> > vec(row,vector<int>(col,-1)); vec[3][3]=3432; vec[3].push_back(1212); vector<int> sub; sub.push_back(4); sub.push_back(3); sub.push_back(2); vec.push_back(sub); fun(vec); }