Let's say I have this C++ code:
void exampleFunction () { // #1
cout << "The function I want to call." << endl;
}
class ExampleParent { // I have no control over this class
public:
void exampleFunction () { // #2
cout << "The function I do NOT want to call." << endl;
}
// other stuff
};
class ExampleChild : public ExampleParent {
public:
void myFunction () {
exampleFunction(); // how to get #1?
}
};
I have to inherit from the Parent
class in order to customize some functionality in a framework. However, the Parent
class is masking the global exampleFunction
that I want to call. Is there any way I can call it from myFunction
?
(I actually have this problem with calling the time
function in the <ctime>
library if that makes any difference)