It's been a while since I've used C++, so I'm a bit rusty with inheritance etc. In Java, you're able to use the super variable to access functions from a base class, even if you've overloaded them in the subclass. Is it possible to do this in C++?
It's been a while since I've used C++, so I'm a bit rusty with inheritance etc. In Java, you're able to use the super variable to access functions from a base class, even if you've overloaded them in the subclass. Is it possible to do this in C++?
Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah
You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie
Like this?
Code:#include <iostream> class A { public: void Func(){ std::cout<<"A Func()"<<std::endl;} }; class B: public A { public: void Func(){ std::cout<<"B Func()"<<std::endl;} }; int main() { B bObj; bObj.A::Func(); }
"Think not but that I know these things; or think
I know them not: not therefore am I short
Of knowing what I ought."
-John Milton, Paradise Regained (1671)
"Work hard and it might happen."
-XSquared
That's exactly what I was looking for. Thanks a lot.
Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah
You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie