Skip to content

Instantly share code, notes, and snippets.

@b4284
Created April 24, 2017 14:11
Show Gist options
  • Select an option

  • Save b4284/21c7fd6615d33246ea3d2009d9281844 to your computer and use it in GitHub Desktop.

Select an option

Save b4284/21c7fd6615d33246ea3d2009d9281844 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
class A {
public:
A(){print();}
virtual print(){cout << "in A"<<endl;}
};
class B: public A{
public:
B(){print();}
virtual print(){cout << "in B"<<endl;}
};
int main(void)
{
B b ;
return 0;
}
Copy link
Copy Markdown

ghost commented Apr 24, 2017

yo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment