1234
int i; int *ptr; ptr = new(nothrow) int [i][i];
12345678910111213141516171819
#include <iostream.h> void main() { const int rows = 4; const int cols = 4; // declaration int ** a; // allocation a = new int*[rows]; for(int i = 0; i < rows; i++) a[i] = new int[cols]; // initialization for(int j = 0; j < rows; j++) for(int i = 0; i < rows; i++) a[i][j] = 0; }