#include<iostream>
using namespace std;
int main()
{
int n=5;
int *p=new int;
p=&n;
cout<<"-------------------"<<endl;
cout<<p[0]<<endl;
free(p);
return 0;}
我不知道为什么VC能打出结果,但是会弹出窗口,提示Debug Assertion Error.,请问下是什么原因。
#include<iostream>
using namespace std;
int main()
{
int n=5;
int *p=new int;
p=&n;
cout<<"-------------------"<<endl;
cout<<p[0]<<endl;
free(p);
return 0;}
我不知道为什么VC能打出结果,但是会弹出窗口,提示Debug Assertion Error.,请问下是什么原因。