下面程序运行时输出结果为【 】。 #include<iostream.h> #include<malloc.h> class Rect { public: Rect(int1,int w)(length=1;width=w;) void P

admin2009-01-15  26

问题 下面程序运行时输出结果为【  】。
#include<iostream.h>
#include<malloc.h>
class Rect
{
public:
Rect(int1,int w)(length=1;width=w;)
void Print(){cout<<"Area:"<<length *width<<endl;)
void *operator new(size-t size){return malloc(size);}
void operator delete(void *p){free(p)
private:
int length,width;
};
void main()
{
Rect*p;
p=new Rect(5,4);
p->Print();
delete p;
}

选项

答案Area:20

解析
转载请注明原文地址:https://kaotiyun.com/show/Vikp777K
0

最新回复(0)