试题与答案

若有以下程序: #include <iostream> using namesp

题型:单项选择题

题目:

若有以下程序:
#include <iostream>
using namespace std;
class Base

private:
int a,b;
public:
Base(int x, int y)

a=x;
b=y;

void show()

cout<<a<<", "<<b<<end1;

;
class Derive : public Base

private:
int c, d;
public:
Derive(int x, int y, int z,int m):Base(x,y)

c=z;
d=m;

void show()

cout<<c<<", "<<d<<end1;

;
int main ( )

Base b(50,50) ,*pb;
Derive d(10,20,30,40);
pb=&d;
pb->show );
return 0;

A.10,20

B.30,40

C.20,30

D.50,50

答案:

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

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

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