Created
April 24, 2017 14:11
-
-
Save b4284/21c7fd6615d33246ea3d2009d9281844 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #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; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
yo