Skip to content

Instantly share code, notes, and snippets.

@ALSchwalm
Last active December 15, 2016 01:52
Show Gist options
  • Save ALSchwalm/d978a2deb7cd47d467323762eede8f98 to your computer and use it in GitHub Desktop.
Save ALSchwalm/d978a2deb7cd47d467323762eede8f98 to your computer and use it in GitHub Desktop.
int main() {
Mammal *m;
if (rand() % 2) {
m = new Cat();
} else {
m = new Dog();
}
m->walk();
delete m;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment