Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

arrays in java

Name: Anonymous 2007-01-16 10:27

can someone tell me how to copy a 2 dimensional array to a 1 dimensional one? Ie.
array:
{2, 3, 5}
{4, 7, 9}
should become {2, 3, 5, 4, 7, 9}

Name: Anonymous 2007-01-16 21:40

>>9
That is in the rare case of a static 2D array.  Dynamic 2D arrays have an array of pointers to each of the rows, which are not stored sequentially, so it is more efficient to use a dynamic 1D array, with something like (x + y*row_size) used to access it.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List