小编Fra*_*tra的帖子

C++为什么make new int是错误的?

为什么我的代码错误?

int *x ;
x = new int[5];
x[0] = 3;
x[1] = 4;
x[2] = 5;
x[3] = 1;
x[4] = 2;
x[5] = 11;
x[6] = 90;
int *y ;
y = new int[5];
cout << "if no error, then this command should be run" << endl;
Run Code Online (Sandbox Code Playgroud)

但输出是:

进程在0.07883秒后退出,返回值为3221226356

按任意键继续 ...

c++ arrays pointers

-6
推荐指数
1
解决办法
304
查看次数

标签 统计

arrays ×1

c++ ×1

pointers ×1