How to call a base member function from derived class member function.

How to call a base member function from derived class member function?

class emp
{
   public:
       void empName()
       {
          cout << "emp-XYZ" << endl;
       }
};

class dept : public emp
{
   public:
       void empName()
       {
          cout << "dept-XYZ" << endl;
          emp::empName();
       }
};
Output :
dept-XYZ
emp-XYZ
Is it possible to overload a constructor?
Is it possible to overload a constructor? - Yes it is possible. A constructor can be overloaded to pass different arguments to the object....
Overriding vs. overloading
Overriding vs. overloading - Overloading means having methods with same name but different signature....
Static vs. dynamic binding - C++
Static vs. dynamic binding - Binding means connecting the function call to a function implementation...
Post your comment