2 questions
I started learning C++Isn't the virtual method used by the child class to override the parent class's method?You can just override it. Why do you have to use the virtual keyword?
In Bar, Foo's virtual void printStuff is overrideI'd like to sing printStuff() of Foo.In Java, we could've used super.printStuff() togetherHow do I use it in C++?class Foo{public: int x; virtual void ...
© 2024 OneMinuteCode. All rights reserved.