Created
January 19, 2016 20:24
-
-
Save therocode/fc1a820bedeff2554368 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 Animal | |
{ | |
public: | |
virtual void makeNoise() const | |
{ | |
std::cout << "...\n"; | |
} | |
virtual ~Animal() {} | |
}; | |
class Monkey : public Animal | |
{ | |
public: | |
void makeNoise() const override | |
{ | |
std::cout << "oh oh AH!\n"; | |
} | |
}; | |
class Giraffe : public Animal | |
{ | |
public: | |
void makeNoise() const override | |
{ | |
std::cout << "moooo\n"; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment