首页 > 代码库 > 模板:使用new delete 创建二维数组

模板:使用new delete 创建二维数组

1 int **arr_matrix = new int*[n];2 for(i = 0; i < n; ++i) arr_matrix[i] = new int[n];3 //内容4 for(i = 0; i < n; ++i) delete [] arr_matrix[i];5 delete [] arr_matrix;