class CParent
{
public:
virtual void Print() { cout << 1 << endl; }
};
class CChild : public CParent
{
public:
virtual void Print()
{
cout << 2 << endl:
// here i want to call the parent so i get the output : "21"
}
};
How can this be done ?
Calling the parent class
How can i call a method in the parent class witch i have overloaded in the child class ?
call
from within
However, you won't get "21" because you have endl in both functions.
[edited by - fizban75 on March 5, 2003 12:54:52 PM]
[edited by - fizban75 on March 5, 2003 12:55:21 PM]
CParent::Print()
CChild::Print()
However, you won't get "21" because you have endl in both functions.
[edited by - fizban75 on March 5, 2003 12:54:52 PM]
[edited by - fizban75 on March 5, 2003 12:55:21 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement