I am trying to use the STL vector multi-dimenstional (I know how to do 2-d but I want to use 3-d

This is what I have tried

vector < vector <vector <int> >> m(3, vector< vector<int> >(4,5));

I also tried the following:

vector < vector <vector <int> >> m(3, vector<int> (5, vector<int> (4)));

I get the similar error as shown above.

Can you please shed some light?

Also is there another way to avoid using 3-d vector if I want to use it for the following

int i,j,k;
float a[i][j][k]=value;

off course I would like to vary the size of array dynamically.

Your help is appreciated.



c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\vector(357): error C2664: 'std::vector<_Ty>::_Construct_n' : cannot convert parameter 2 from 'int' to 'const std::vector<_Ty> &'