填空题
下面程序的输出结果为:Base::fun,请将程序补充完整。
#include<iostream.h>
class Base
public:
【12】
fun()cout<<"Base::fun"<<end1;
;
class Derived:public Base
public:
【13】
fun()cout<<"Derived::fun"<<end1;
;
int main()
Base a,*pb;
Derived b;
pb=&b;
pb->tim();
return 0;
【参考答案】
[12]virtual void [13]void
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
填空题
下列程序的输出结果是 【14】 #include<iOStream> using namespace std; template <typename T> T total (T*datA) T s=0; while(*datA) s+=*data++; return s; int main() int x[]=2,4,6,8,0,12,14,16,18; cout<<total(x)<<end1; return 0;
点击查看答案&解析
填空题
多态性分为两类:编译时的多态性和 【10】 的多态性。
点击查看答案&解析
相关试题
C++中,设置虚基类的目的是 【11】 。
下面程序的输出结果是 【15】 。 #in...