Greetings,
I'm just learning c++, so I hope my question is not ridiculous?
My dilemma is that I'd like to be able to programmatically override a method INSIDE a single class. Is this even possible?
Here is a pseudo-code example:
Code:
Class Processor {
void SetUpProcessor(int choice) {
if (choice == 0) {
howToProcess = DoItThisWay();
}
if (choice == 1) {
howToProcess = DoItThatWay();
}
}
double DoItThisWay(double input) {
...blaa blaa
}
double DoItThatWay(double input) {
...blaa blaa
}
double Process(double input) {
return howToProcess(input);
}
}
Thanks for your patience