Skip to content

Instantly share code, notes, and snippets.

@srikiraju
Created May 18, 2014 07:29
Show Gist options
  • Save srikiraju/a19694634607141079e3 to your computer and use it in GitHub Desktop.
Save srikiraju/a19694634607141079e3 to your computer and use it in GitHub Desktop.
//blah.hpp
class Base {
public:
virtual void coolShit() = 0;
};
class Derived : public Base {
public:
void coolShit();
};
extern Base* basePtr;
//blah.cpp
#include "vcalls.hpp"
#include <iostream>
Base* basePtr = new Derived();
void Derived::coolShit() {
std::cout << "Derived coolShit";
};
int main(int argc, char** argv) {
basePtr->coolShit();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment