I need a large 3D array (typical size 4000x400x3) in my program. Which is more efficient of -
(1) dynamically allocate a 1D array, then use index calculation (I am thinking of a macro) to simulate 3D array
(2) dynamically allocate 3D array and use it directly.
Will things change for a 2D array?
In my program, the array elements will be referenced like 2-4 million times in a typical execution.