int** ary = new int[sizeY][sizeX]应该:int **ary = new int*[sizeY];for(int i = 0; i < sizeY; ++i) { ary[i] = new int[sizeX];}然后清理将是:for(int i = 0; i < sizeY; ++i) { delete [] ary[i];}delete [] ary;编辑:正如Dietrich Epp在评论中指出的那样,这并不是一个轻量级的解决方案。另一种方法是使用一个大的内存块:int *ary = new int[sizeX*sizeY];// ary[i][j] is then rewritten asary[i*sizeY+j]