D
Dylan
thanks for any comments. Here's the code
//------------------------------------------------------------------
#include <iostream>
class Base
{
protected:
virtual int GetValue()=0;
public:
Base(){PrintValue();}
void PrintValue(){std::cout << GetValue();}
};
class Child : public Base
{
public:
int GetValue(){return 2;}
};
int main()
{
Child c;
return 0;
}
//------------------------------------------------------------------
#include <iostream>
class Base
{
protected:
virtual int GetValue()=0;
public:
Base(){PrintValue();}
void PrintValue(){std::cout << GetValue();}
};
class Child : public Base
{
public:
int GetValue(){return 2;}
};
int main()
{
Child c;
return 0;
}