填空题
以下程序的执行结果是
【15】
。
#include<iostream. h>
class Sample
public:
int x:
int y;
void disp()
cout<<"x="<<x<<",y="<<y<<end1;
;
void main()
int Sample:: ** pc;
Sample s;
pc=& Sample: :x;
s.*pc=10;
pc:=&Sample: :y;
s.*pc=20;
s.disp();
【参考答案】
x=10,y=20
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
填空题
若需要定义一个标识符常量,并且使得C++能够进行类型检查,则应在定义语句的开始使用保留字 【10】 。
点击查看答案&解析
填空题
下列程序的运行结果是 【11】 。 #include<iostream, h> class Base public: void f(int x) cout<< Base: <<x<<end1; ; class Derived: public Base public: void f(char * str) cout<< Derived: <<str<<end1; ; void main(void) Base * pd=new Base; pd=new Derived; pd->f(’a’)
点击查看答案&解析
相关试题
下列程序用于将源文件中的字母进行大小写转...