Created
April 19, 2019 22:24
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 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; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment