cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
dynamically allocating a three dimension
dynamically allocating a three dimensional array
Jan 24, 2009 at 10:10am UTC
cpppuneet
(1)
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
Jan 24, 2009 at 11:25am UTC
anders43
(125)
what do you have so far?
Jan 24, 2009 at 2:07pm UTC
Bazzy
(6281)
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
Jan 24, 2009 at 3:08pm UTC
Jan 25, 2009 at 7:39pm UTC
Zaita
(2770)
Another approach is a vector of vector of vector.
e.g
vector<vector<vector<
double
> > > my3DArrayofDoubles;
Topic archived. No new replies allowed.