int **p;
p=(int **)malloc(m*n*sizeof(int));
m and n are the rows and columns .....
this is how you have to allocate memory to 2D array. No one max limit is needed.....