一道c++题 求解析

下面程序的运行结果是______。
#include
class Point
{ public:
Point ( int a, int b )
{ x=a ; y=b ; cout << "Constructor Called." << endl ; }
Point ( const Point &p ) ;
~Point( )
{ cout << "Destructor Called.\n" ; }
int xcord( ) { return x ; }
int ycord( ) { return y ; }
private:
int x , y ;
};
Point :: Point ( const Point &p )
{ x=p.x ; y=p.y ; cout << "Copy_initialization Constructor Called.\n" ; }
Point move ( Point q )
{ cout << "ok\n" ;
int a , b ; a=q.xcord() 10 ; b=q.ycord() 20 ;
Point p ( a , b ) ; return p ; }
void main( )
{ Point m( 15 , 40 ) , p( 0 , 0 ) ;
Point n( m ) ;
p = move( n ) ;
cout << "p=" << p.xcord() << "," << p.ycord() << endl ;
} #C语言编程题#  #题解#
全部评论

相关推荐

收到了小米的实习offer,犹豫是否要去。。。
认真搞学习:雷总还当过首富呢,公司不算大厂算独角兽吗
点赞 评论 收藏
分享
06-13 10:15
门头沟学院 Java
想去夏威夷的大西瓜在午休:我也是27届,但是我现在研一下了啥项目都没有呀咋办,哎,简历不知道咋写
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
06-20 14:55
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务