Wanting2LearnMan
asked on
Abstract base class question C++
I I have an abstract base class in c++ as follows:
When I go to implement a class with this interface as follows:
Do I have to include the word virtual before the function name in this class definition??
e.g.
instead of just:
Can you explain your answer please?
class IMyBaseClass
{
public :
virtual ~IMyBaseClass() {}
virtual void AddSomeInformation( int param1, int param2) = 0;
virtual void AddSomeMoreInformation( int param1) = 0;
};
When I go to implement a class with this interface as follows:
class MyBaseClass : public IMyBaseClass
{
public :
virtual ~IMyBaseClass() {}
void AddSomeInformation( int param1, int param2);
void AddSomeMoreInformation( int param1);
};
Do I have to include the word virtual before the function name in this class definition??
e.g.
virtual void AddSomeInformation( int param1, int param2);
instead of just:
void AddSomeInformation( int param1, int param2);
Can you explain your answer please?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.