Original Post
I am having a few weird inheritance problems, which I don''t seem to be able to solve. I always figured that use a virtual function in the base class, would have it overwritten when it''s derived. Since I did this(below), somehow it doesn''t call the functions in the derived class.
-Earth is 98% full. Please delete anybody you can.
class CBase
{
public:
CBase();
~CBase();
virtual void X(int i, int n);
};
class CDerived : public CBase
{
public:
CDerived();
~CDerived();
virtual void X(int i, int n);
};
class CApp : public CDerived
{
public:
CApp();
~CApp();
void X(int i, int n);
};
CApp App; App.X(1, 1);That code results in CDerived::X(int i, int n) being called, instead of my CApp::X() function, why is this? Toolmaker
-Earth is 98% full. Please delete anybody you can.