Higher dimensional array vs 1-D array efficiency in C++ -


i'm curious efficiency of using higher dimensional array vs 1 dimensional array. lose when defining, , iterating through array this:

array[i][j][k]; 

or defining , iterating through array this:

array[k + j*jmax + i*imax]; 

my inclination there wouldn't difference, i'm still learning high efficiency programming (i've never had care kind of thing before).

thanks!

the way know sure benchmark both ways (with optimization flags on in compiler of course). 1 think lose sure in second method clarity of reading.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -