+ 1
What to be filled in the blanks
Inheritance while using protected
3 ответов
+ 2
No blanks. Add the blanks please.
+ 1
#No blanks. Add the blanks please.#include <iostream>
using namespace std;
class B {
protected:
int data;
};
class D1 : public __________ B { //LINE 1
public:
void show() {
cin >> data;
cout << "Data in class D1 is:" << data << endl;
}
};
class D2 : __________ public B { //LINE 2
public:
void out() {
cin >> data;
cout << "Data in class D2 is:" << data << endl;
}
};
- 1
Reply me soon