文档分类
Coordinate p1(3,4); Coordinate p2(p1); Coordinate p3=p2; cout<<"p3=("<<p3.getx()<<","<<p3.gety()<<")"<<endl;
return 0;}
1)运行结果
2)将Coordinate类中带有两个参数的构造函数进行修改,在函数体内增加如下语句: cout<<”Constructor is called.”<<endl;
运行结果: