填空题
虚函数必须是类的
【12】
。
【参考答案】
成员函数
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
填空题
在下面横线上填上适当的语句,完成程序。#include <iostream>using namespace std;class Base{int x;public:Base(int i) {x=i;}~Base(){}};class Derived: public Base{public:______∥完成类 Derive 构造函数的定义};int main(){Derived Obj;return 0;}在横线处应填入的语句是 【11】 。
点击查看答案&解析
填空题
下面程序的输出结果是 【8】 。#include <iostream>using namespace std;int x;void funA(int&,int);void funB(int,int&);int main(){int first;int second=5;x=6;funA(first,second);funB(first,second);cout<<first<< <<second<< <<x<<endl;return 0;}void funA(int &a,int b){int first;first=a+b;a=2*b;b=first+4;}void funB(int u,int &v){int second;second=x;v=second+4;x=u+v;}
点击查看答案&解析
相关试题
有以下程序:#include <iostream>using...
下面是复数类complex的定义,其中作为友元...
【13】 允许用户为类定义一种模式,使得...