填空题

C++中,设置虚基类的目的是 【10】 。

【参考答案】

解决二义性问题
<上一题 目录 下一题>
热门 试题

填空题
有以下程序: #include <iostream> using namespace std; class sample int x; public: void setx(int i) x=i; int putx () return x; ; int main ( ) sample *p; sample A[3]; A[0] .set>:(5); A[1] .setx(6); A[2] .setx(7); for (int j=0;j<3;j++) p=&A[j]; cout<<p->putx () << , ; cout<<end1; return 0; 执行后的输出结果是 【14】 。
填空题
以下程序的输出结果是 【9】 。 #include<iostream> using namespace std; void fun() static int a=0; a+=2; cout<<a; int main() int cc; for(cc=1;cc<4;cc++) fun(); cout<<end1; return 0;
相关试题
  • 下面程序的预设功能是:统计文件abc.txt中...
  • 有如下程序: #include <iostream> u...
  • C++语言中,派生类继承了基类的全部数据...