#include <iostream>
using namespace std;
int main()
{
int column = 2, row = 3;
int **array = new int *[row];
for (int i = 0; i < column; i++)
{
array[i] = new int[column];
}
for (int i = 0; i < row; i++)
{
for (int j = 0; j < column; j++)
{
array[i][j] = -1;//making every entry -1
}
}
cout << "SUCCESS" << endl;
return 0;
}
当我运行上面的代码时出现分段错误。有人可以向我解释为什么当我运行上面的代码时出现分段错误吗?