I've seen how to dynamically allocate a two-dimensional array row by row. But why couldn't you just simply allocate the memory and cast it into a 2D array, like this:
I guess it's not technically an array of an array, but the result will achieve that effect. Also, this would be handy:Code:// I want a dynamically allocated int, so allocate enough memory: int* buffer = new int [2 * 2]; // And do the cast: int (*p_array)   = (int (*)  ) buffer; // ... delete  buffer; // Or, delete  p_array; ?
Code:int (&the_array)   = *p_array;