my_2D_vector.resize(4); //since you want 4 rows
//now fill first row with data
my_2D_vector[0].push_back('1'); //I'm not sure if you want '1' to actually be part of the data
my_2D_vector[0].push_back('a');
my_2D_vector[0].push_back('b');
//etc...
//then fill second row with data
my_2D_vector[1].push_back('2'); //same here for '2'. If you don't want it just ignore this line
my_2D_vector[1].push_back('k');
my_2D_vector[1].push_back('l');
//etc...
//...
//and after you fill it you can use it like:
int i,j;
cout << "enter i j: ";
cin >> i >> j;
cout << "element in row i, column j is: ";
cout << my_2D_vector[i][j] << endl;
EDIT:
If the row length is fixed you can simply use an array of vectors. If the length is known at compilation time you can do it like:
1 2
constint length=10; //or anything you like
vector<char> my_static_varray[length];
And if the length is entered by the user during runtime you can do it like this:
1 2 3 4 5 6 7 8 9
int length;
cout << "enter length: ";
cin >> length;
vector<char> * my_dynamic_varray=new vector<char>[length];
//...
//use it here any way you want
//...
//and delete it when you 're done with it
delete[] my_dynamic_varray;