No. These two things behave differently :
int a[10][20];
int * a[10]; //then fill a with int[20]'s
the first object is actually an array of the form a[200], and when you access a[j][k] it actually accesses a[j+10*k]. The "10*k" part is the slow part about it : to access an element you do 1 mul and 2 add, then a dereferencing :
a[j][k] == *(a+j+10*k)
the second object is actually an int** object, so you are basically adding, dereferencing, adding again, and dereferencing again :
a[j][k] == *(*(a+j)+k)
the second method is of course faster, but it's slower to set up (because you need to allocate additional memory and set it up. Still, a good way would be to allocate on the stack something like this :
int a[10][20];
int * b[10];
for( j = 0; j < 10; ++j ) { b[j] = &(a[j][0]); }
And then use b[j][k] to access the elements.
Victor Nicollet, INT13 game programmer
[edited by - ToohrVyk on March 20, 2004 11:07:48 AM]