Skip to content

Instantly share code, notes, and snippets.

@joe714
Created July 14, 2014 17:46
Show Gist options
  • Save joe714/9aa2da548652aefa7a65 to your computer and use it in GitHub Desktop.
Save joe714/9aa2da548652aefa7a65 to your computer and use it in GitHub Desktop.
#include <iostream>
class A {
public:
virtual int get_foo() = 0;
};
class B {
public:
virtual int get_foo() { return 3; }
};
class C : public A, B {
};
int main(int argc, char** argv) {
A* a = new C();
std::cout << a->get_foo() << std::endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment