Why i can't watch the expression a[1][1] after declare it by a[n][n] in c++?-Collection of common programming errors

why not better do it a dynamic 2d array? In that case you do not have to make the n constant, and you can determine the size dynamically.

int **arr, n;

arr = new int * [n]; // allocate the 1st dimension. each location will hole one array
for (i=0; i