I have a class (child) that is inheriting from another class (parent). I'd like to create a function in the child class w/the same name and arguments as a function in the parent class, and have the child class call the function in the parent class before it (the child function) exits. What is the syntax to do this?
class parent {
public:
int test;
virtual function foo(int input) { test=input; }
}
class child : parent {
public:
int new_test;
virtual function foo(int input) { new_test=input; <call parent function foo here> }
}
so when you call child.foo, new_test and test are set to input.