急!指针问题

cityyokel cityyokel 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
int main()
{
int *arrInt1=new int(10);
int *arrInt2=new int(10);
int *arrInt3=new int(10);
int *arrInt4=new int(10);
for(int i=0;i<10;i++)
{
arrInt1[i]=1;
arrInt2[i]=5;
arrInt3[i]=10;
arrInt4[i]=15;
}
int *arrInt[]={arrInt1,arrInt2,arrInt3,arrInt4};

for(int j=0;j<4;j++)
for(int n=0;n<10;n++)
cout<<arrInt[j][n]<<" ";
cout<<endl;

}

程序输出完毕,忽然弹出对话框:
Debug Assertion Failed!
......
忽略完了后,又正常。

这是为什么???

急!
...全文
评论 6
收藏 已收藏
分享
返回顶部
cityyokel
C语言 70,040 成员 243,237 内容