You should read up on virtual methods.
class Greeting
{
public:
// Here is our abstract, overridable method
virtual std::string hello() const = 0;
};
// Here is an example of how it is used
class Saludo: public Greeting
{
public:
std::string hello() const { return std::string("Buenos Dias"); }
};
Hope this helps.
Duoas
Postaholic
2,043 posts since Oct 2007
Reputation Points: 1,140
Solved Threads: 229