is there any way i can make the following work, or is there a work around? I must be missing something.
class base
{
public:
int someInt;
virtual void someFunction(){}
};
class derived : public base
{
public:
void someFunction(){}
void anotherFunction(){}
};
int main (int argc, char * const argv[]) {
base* aBasePointer = new derived;
aBasePointer->anotherFunction();
delete aBasePointer
return 0;
}
anotherFunction()to be virtual in base as well. Or call it through a pointer to derived. At the moment base knows nothing about this function.