Minor C++ help

Recommended Videos

SirDoom

New member
Sep 8, 2009
279
0
0
Ok, I've tried pretty much everything on this one, and I just can't seem to figure it out. So, to anyone who knows C++ here, could you please point out the thing I'm missing?

Ok, the problem is with derived classes. See, I have this base class that I'm not allowed to edit (although I can edit the header files for the base class). In this class, I have this public function (with comments!)


----

void BaseClass::UpdateOutput()
{
/* No code here -- placeholder for derived classes */
} // End Operator::UpdateOutput()


----

Now, in the derived classes, I have other functions also called UpdateOutput, and all the code needed to update the output has been written and tested in those functions.

The problem? The main function calls BaseClass::UpdateOutput(), not those other functions with the code. It's running the base class's blank function instead of the one with all the code, and I can't edit main or the base class.

I've looked for ways to link my other update functions to this one, and have come up with nothing other than going in and manually deleting all that placeholder text and copying the code there, which I'm not allowed to do.

I've got everything else in this program done, but after a few hours of failed attempts, I've had no luck with this one. Any suggestions?