?????5_ level
获赞
0
粉丝
0
关注
4
看过 TA
0
东南大学成贤学院
2022
后端工程师
IP属地:江苏
暂未填写个人简介
私信
关注
2023-03-15 00:32
已编辑
东南大学成贤学院 后端工程师
下面程序的运行结果是______。#includeclass 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 ;}
0 点赞 评论 收藏
分享

创作者周榜

更多
关注他的用户也关注了:
牛客网
牛客网在线编程
牛客网题解
牛客企业服务