请教一个程序崩溃的问题
#include <iostream>using namespace std;
void barmsg(int [][4]);
int main()
{
int barmessage[1000][4]={{0}};
barmsg(barmessage);
//cout<<barmessage[999][3];
return 0;
}
void barmsg(int barmessage[][4])
{
int arrs,cols=4;
cout<<"please enter the number of bar:";
cin>>arrs;
int bar[][4]={{0}};
for (int i=0;i<arrs;i++)
{
for (int j=0;j<4;j++)
{
cin>>bar[i][j];
barmessage[i][j]=bar[i][j];
}
}
for (int k=0;i<arrs;k++)
{
for (int j=0;j<4;j++)
{
cout<<barmessage[k][j]<<"\t";
}
cout<<endl;
}
}
我只是想把barmessagel里赋值,不知道程序为什么会崩溃 ??谢谢