填空题
阅读下面程序:
#include<iostream.h>
void fun1(char a,char b)
char c;
c=a;a=b;b=c;
void fun2(char &a,char &b)
char c;
c=a;a=b;b=c;
void main()
char a,b;
a=’x’;b=’y’;
fun1(a,b);cout<<a<<b;
a=’x’;b=’y’;
fun2(a,b);cout<<a<<b;
则该程序的输出为______。
【参考答案】
xyyx
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
填空题
非成员函数只有在声明为类的______时才能访问这个类的所有private成员。
点击查看答案&解析
填空题
在下面的程序的横线处填上适当的语句,使该程序的输出为12。 #include<iostream.h> using namespace std; class Base public: int a,b; Base(int i)a=i; ; class Derived:public Base int a; public: Derived(int x):Base(x),b(x+1); void show() ______; 输出基类数据成员a的值 cout<<b<<endl; ; int main() Derived d(1); d.show(); return 0;
点击查看答案&解析
相关试题
执行语句序列: int x=10,&r=x; ...
在下面函数的横线处填上适当的内容,使该函...
下面是一个栈类的模板,其中push函数将元素...