dynamically allocating a three dimensional array

hello,
can any tell me how to dynamically allocate a 3d array and populate values into it and how to index into individual array element







regards puneet vyas
what do you have so far?
You could start from a pointer to pointer to pointer (eg: int***) and once created the outer array of pointers to pointer, use a loop to allocate each element as array of pointers and then a nested loop to create the third dimension
Last edited on
Another approach is a vector of vector of vector.

e.g
vector<vector<vector<double> > > my3DArrayofDoubles;
Topic archived. No new replies allowed.