填空题
将关键字const写在函数头之后,函数体之前,说明该函数是一个const成员函数。此时const不是指定函数的返回值,而是修饰
【10】
指针。
【参考答案】
this
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
填空题
下列程序的输出结果为 【12】 。# include <iostream, h>void Func(char ch){switch (ch).{case ’A’: case ’a’cout<< 优秀 <<end1;case ’B’: case ’b’:cout<< 良好 <<end1;break;case ’C’: case ’c’:cout<< 及格 <<end1break;defaultcout<< 不及格 <<end1;}}void main(){char ch1 =’b’Fune(chl);Func(’A’);}
点击查看答案&解析
填空题
根据注释内容在空白处填写适当内容。class Location{private:int X,Y;public:void init(int init X,int init Y);int GetX( );int GetY( )};void Location:: init(int initX,int initY){X = initXY=initY;}int Location: :GetX( ){reutrn X}int Location: :GetY( ){reutrn Y;}# inelude<iostream. h>void main( ){Location A1;A1. init (20, 90)【13】 定义一个指向A1的引用rA1cout<<rA1. GetX()<< : <<rA1. GetY()<<end1;}
点击查看答案&解析
相关试题
下列类的构造函数不能通过编译,正确的构造...