I have defined a class A and derived a new class B from A .
I have overloaded SetData() function in class B.
When I tried to access SetData function of class B using object of B, compiler doesn’t permit it. Why is it so ?
class A{
public :
void SetData();
};
class B : public A {
public:
void SetData(int);
};
B b;
b.SetData() ; // error
OMG, no error message. -1 for you.
But let us use telepathy and guess your error message. You’re getting something like “symbol not found” because you try to call a function
B::SetData()which doesn’t have a body. And it must have a body even if it does nothing and even if it’s declared in parent class! Try adding it into the body of your classor outside of it