Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Base
- {
- public:
- virtual void SetValue(int v)
- {
- a = v;
- }
- void SetValue(std::string str)
- {
- b = str;
- }
- void SetValue(bool val)
- {
- c = val;
- }
- private:
- int a;
- std::string b;
- bool c;
- };
- class Derived : public Base
- {
- public:
- virtual void SetValue(int v) override
- {
- //
- }
- };
- int main()
- {
- Derived d;
- d.SetValue("string"); // cant use string as argument
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement