Created
April 19, 2019 22:24
-
-
Save chichunchen/4c7f052ed4ee64ebd145d3875fa8fc13 to your computer and use it in GitHub Desktop.
Revisions
-
chichunchen created this gist
Apr 19, 2019 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ #include <iostream> using namespace std; class Base { public: // user wants to override this in // the derived class virtual void func() { cout << "I am in base" << endl; } }; class derived : public Base { public: // did a silly mistake by putting // an argument "int a" void func(int a) override { cout << "I am in derived class" << endl; } };