请写出下列程序的运行结果。(c++)
classPoint{public:Point(){X=Y=0;cout<<"DefaultConstructorcalled."<<endl;}Point(intxx,...
class Point
{ public:
Point()
{ X=Y=0;
cout<<"Default Constructor called."<<endl; }
Point(int xx,int yy)
{ X=xx; Y=yy;
cout<< "Constructor called."<<endl; }
~Point()
{ cout<<“Destructor called.”<<endl; }
private:
int X,Y; };
void main()
{ cout<<"Entering main..."<<endl;
Point A[2];
cout<<"Exiting main..."<<endl; } 展开
{ public:
Point()
{ X=Y=0;
cout<<"Default Constructor called."<<endl; }
Point(int xx,int yy)
{ X=xx; Y=yy;
cout<< "Constructor called."<<endl; }
~Point()
{ cout<<“Destructor called.”<<endl; }
private:
int X,Y; };
void main()
{ cout<<"Entering main..."<<endl;
Point A[2];
cout<<"Exiting main..."<<endl; } 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询