I have a function under Base class and at the definition tine of this base class function I need to call another function which is define under the Derived class. how to do this??
My class declaration is below
class Base{
public:
void showdata(double);
};
class Derived : public Base{
public:
inline double F(double x)
{
return exp(-x) + x*x;
}
Define the function below :
void Base::showdata(double a)
{
std::cout<<"The value of the Function : " << F(a);
}
and the main function :
int main()
{
//Base obj;
Derived obj;
obj.F(1.0);
return 0;
}
I'm getting an error :
error C3861: 'F': identifier not found
So how to solve this problem.
With Warm Regards
sdmahapatra