-
December 25th, 2003, 06:47 PM
#1
Multi-dimension STL vector
Help!
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.
AD
****************************************************
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> &'
with
[
_Ty=std::vector<int>
]
and
[
_Ty=int
]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|