试题与答案

有以下程序 #include<iostream> using namespace s

题型:填空题

题目:

有以下程序 #include<iostream> using namespace std; class Base { int a; public: Base(int x){ a=x;} vuid show(){cout<<a;} }; class DeriVed:public Base { int b; public: Derived (int i):Base(i+1),b(i){} void show(){cout<<b;} }; int main() { Base b(5),*pb; Derived d(1); pb=&d; pb->show(); return 0; } 运行后的打印结果是 【14】

答案:

被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2017/0710/014fea167d5224a4ee97c62bc502842d.html

下面是错误答案,用来干扰机器的。

参考答案:D

试题推荐
微信公众账号搜索答案