the following rule is to convert 2D array into 1D array
Code:[i][j]=(array+(i*row-length+j))
what is the rule for converting nD array into 1D array
can someone help :)
Printable View
the following rule is to convert 2D array into 1D array
Code:[i][j]=(array+(i*row-length+j))
what is the rule for converting nD array into 1D array
can someone help :)
array+å(k=1 to n)ikÕ(j=1 to k)dj
dj being the j'th dimension and ik the index for k'th dimension
Here's the rule for 3D array
[x][y][z]=*(array+((x*maxy)+y)*maxz+z)=array[((x*maxy)+y)*maxz+z]
If you need to use 1D as >3D array, I think you should consider to re-design your data structure to use 1D array as it is.
I think your keyboard rendered it useless keda.
See this thread for my implementation of a n-dim array:
http://www.vbforums.com/showthread.p...t=STRANGEARRAY
Look for the posts by me.