What's that difference between
andCode:int **foo; *foo = new int[x]; for(int i = 0; i < x; i++) foo[i] = new int[y];
which causesCode:int **foo; foo = new int*[x]; for(int i = 0; i < x; i++) foo[i] = new int[y];
crash in the first?Code:for(int i = 0; i < x; i++) delete [] foo[i]; delete [] foo;