Skip to content

Instantly share code, notes, and snippets.

@cleak
Created January 2, 2019 01:05
Show Gist options
  • Save cleak/86af41a0e35ef2c75d9df07256e26c25 to your computer and use it in GitHub Desktop.
Save cleak/86af41a0e35ef2c75d9df07256e26c25 to your computer and use it in GitHub Desktop.
class GenericGreeter {
public:
virtual void Greet(const char* name) {
cout << "Hi " << name << "." << endl;
}
virtual void Dismiss(const char* name) {
cout << "Bye " << name << "." << endl;
}
};
class FriendlyGreeter : public GenericGreeter {
public:
virtual void Greet(const char* name) {
cout << "Hello " << name << "! It's a pleasure to meet you!" << endl;
}
virtual void Dismiss(const char* name) {
cout << "Farewell " << name << "! Until later!" << endl;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment