显示“Run-Time Check Failure #2 - Stack around the variable 'b' was corrupted.
”,真的不知道啥原因
int main() {
int a[2][3] = { {1,2,3},{4,5,6} };
int b[3][2], i, j;//定义b是一个三行2列数组
cout << "array a:" << endl;
for (i = 0; i < 2; i++)
{
for (j = 0; j < 3; j++)
cout << a[i][j] << " ";
b[j][i] = a[i][j];
cout << endl;//输出一行进行换行
}
cout << "array b:" << endl;
for (i = 0; i < 3; i++)
{
for (j = 0; j <2; j++)
cout << b[i][j] << " ";
cout << endl;
}
cout << endl;
return 0;
}