64,646
社区成员
发帖
与我相关
我的任务
分享
#include<iostream>
using namespace std;
class Base
{
public:
Base()
{
cout<<"Base"<<endl;
}
void Disp()
{
cout<<"display"<<endl;
}
};
Base* f()
{
Base *pBase= new Base();
delete pBase;//在这句后面加上pBase = NULL;也能正常运行。
return pBase;
}
int main()
{
Base* a=f();
a->Disp();
return 0;
}
a->Disp(); // 函数内部没有访问a/this
int arr[10];
arr[10]=15;//明显的数组越界 不过不一定会出问题 能"正常运行"也不是没见过
int i;
scanf("%d", &i);//输入3 8 1 4 9....都能得到正确答案 但是如果输入0 那么.......
printf("%lf", 1.0/i);