If I declare a 2d c-style array
int data[X][Y]
I assume that the compiler will create this as a single array, similar to
int data[X*Y] , but is it guaranteed?
Let's say for simplicity we use standard compilers for the x86 architecture. Now about
int data[X][Y][Z] ?
Does the compiler create this as a contiguous block of memory and just do some offsets?
I usually use a single vector for a 2d array with a line offset of * NumCols + col and have a built-in function to calculate it for me, but I was interested in a 3D array for this question. I must also ask if anyone did this with a single vector, and what will be the bias logic.
c ++ c arrays
bjackfly
source share