1. vector push_back array

hi,

I've recently changed some code in my program from a multidimensional array to a vector, and I'm wondering if/how it's possible to initialise a vector array.
i.e.
vector<int> MyVector;
MyVector.push_back(int1,int2,int3,int4,int5);

old code:
Code:
```	//header
extern int LIST[][5];

//source
int LIST[][5] =
{
{24,3,2,5,16};
{24,2,5,16,3};
{n1,n2,n3,n4,n5};
};```

//new code
Code:
```	//header
extern vector<int> LIST[5];

//source
void Create_List()
{
FillList(24,3,2,5,16);
FillList(24,2,5,16,3);
FillList(n1,n2,n3,n4,n5);
}

bool FillList(int i1, int i2, int i3, int i4, int i5)
{
LIST[0].push_back(i1);
LIST[1].push_back(i2);
LIST[2].push_back(i3);
LIST[3].push_back(i4);
LIST[4].push_back(i5);

return true;
}```

At the moment, I use FillList() function to populate the vector. Just wondering if there's a better way to do this other than calling another function each time ?

Thanks!

2. If you also have the array, you can pass that to the vector constructor so that the vector gets initialized with the values in the array.
Code:
`vector<int> list(list_array, list_array + sizeof(list_array) / sizeof(int));`

Was a little stuck but managed to figure it out from your post.

Code:
`    vector<int> iVec(*iListArray,*iListArray+sizeof(iListArray) / sizeof(int));`

How would one access then a particular element within vector, like you do an array given the above initialisation?
i.e.
Code:
```int LIST[][5] =
{
{1,2,3,4,5},
{6,7,8,9,10},
};

cout << LIST[2][3];```
cout << iVec[i][j] doesn't work with the above particular setup?

Thanks!

4. Firstly, iVec would need to be either an array of vectors, or a vector of vectors (otherwise the two-dimensional syntax is invalid).

Each element of iVec would then be a vector (which can each be initialised using an approach like that described by MemLoop). You won't be able to avoid either some loop construct and/or usage of some temporary array (or vector) of ints.

When you start going to multiple dimensions with vectors, things become (literally) recursive.