Back To C++ Inheritance Index
add theory here
//example of single level inheritance, class is derived from base class through protected access mode #include
#include
class employee { protected: int ecode; char ename[20]; int salary; public: void egetdata() { cout<<"\nenter employee code "; cin>>ecode; cout<<"\nenter employee name "; cin>>ename; cout<<"\nenter salary of employee "; cin>>salary; } void eshowdata() { cout<<"\nemployee code is "<
>title; } void mshowdata() { eshowdata(); cout<<"\ntitle of manager is "<