July 5, 2009 at 11:31 pm #3583
The best thing to do in c/c++ is check that the indexes are with in range :
int array [ 2] [ 2 ];
if ( i < 2 && j < 2 )
var = array [ i ] [ j ];
since c/c++ does not use array descriptors ( an array header with the maximum length information ) there is really no other way I can think of.