Back To C++ Inheritance Index
add theory here
member functions in the derived class has the same name as that in base class
//program to demonstrate single level inheritance, class is derived from base class through public access mode //member functions in the derived class has the same name as that in base class #include
#include
class employee { int ecode; char ename[20]; public: void getdata() { cout<<"\nenter employee code "; cin>>ecode; cout<<"\nenter employee name "; cin>>ename; } void showdata() { cout<<"\nemployee code is "<
>title; } void showdata() { employee::showdata(); cout<<"\ntitle of manager is "<