#include <iostream>
using namespace std;
class Person {
public:
void sing();
};
class Child : public Person {
public:
void sing();
};
Person::sing() {
cout << "Raindrops keep falling on my head..." << endl;
}
Child::sing() {
cout << "London bridge is falling down..." << endl;
}
int main() {
Child suzie;
suzie.sing(); // I want to know how I can call the Person's method of sing here!
return 0;
}
suzie.Person::sing();
The child can use Person::sign().
See http://bobobobo.wordpress.com/2009/05/20/equivalent-of-keyword-base-in-c/ for a good explanation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With