Dynamic 3D array allocation
using new & delete, how do I dynamically allocate & deallocate a 3 dimensional array?
-Vulcan
Triple pointer, allocate outermost array (array of double pointers) and so on successively for each ''layer'' until you have allocated a linear array (after which there is nothing to do except initialize and use).
There was a recent thread on 2D array allocation, and a post there gave a description of how the technique was extensible to n-dimensions. I suggest you peruse it.
There was a recent thread on 2D array allocation, and a post there gave a description of how the technique was extensible to n-dimensions. I suggest you peruse it.
Where did that post go, dude? I need to know how to pass a pointer to a multi-dimensional array to a function.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement