Archived

This topic is now archived and is closed to further replies.

norleaf

question: different dimensional arrays?

Recommended Posts

norleaf    122
Hi all, hope this isn´t the wrong place... then plz point me in the right direction... I wonder if I can take a simple layer out of an 3 dimensional array and store it in a 2d array... I have no idea what the code should look like unless I copy one number at a time... something like : my2dArray[x][y] = my3dArray[x][y][3]; but this works only if inside two for-loops running through numbers x and y... but isn´t there any smarter solution?] [edited by - norleaf on October 12, 2003 11:33:14 AM]

Share this post


Link to post
Share on other sites
Ilici    862
using Array3D[128][128][128] - to get a 128x128 slice do:

memcpy(Array3D[slicex], Array2D, 128x128);



[ My Site ]
''I wish life was not so short,'' he thought. ''Languages take such a time, and so do all the things one wants to know about.'' - J.R.R Tolkien
/*ilici*/

Share this post


Link to post
Share on other sites