Created
January 2, 2019 01:05
-
-
Save cleak/86af41a0e35ef2c75d9df07256e26c25 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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