SlideShare a Scribd company logo
Inheritance in C++
JUNAIDVK
junaidvkomy@gmail.com
www.facebook.com/junaid.omy
twitter.com/junaid.omy
in.linkedin.com/in/junaidvkomy
9745991390
INHERITANCE
CONTENTS
• CLASS
BASE CLASS
DERIVED CLASS
• OBJECT
• INHERITANCE
SINGLE INHERITANCE
MULTIPLE INHERITANCE
HIERARCHICAL INHERITANCE
MULTILEVEL INHERITANCE
HYBRID INHERITANS(Virtual
Inheritance)
CLASS
• Class is the base design of objects
means expanded concept of a data,
that can hold both data and functions.
• No memory is allocated when class is
created.
• It is a user defined data type.
Example : A car is consider
as a class
Methods : Engine, wheels,
steering.
Properties : company,
model, colour,
speed, etc….
BASE CLASS
• The class from which the subclass is
derived is called a superclass (also a
base class or a parent class).
DERIVED CLASS
• A class that is derived from another
class is called a subclass (also a derived
class, extended class, or child class).
OBJECT
• Object is the instance of class, means
identifiable entity with some
characteristics and behaviour.
• Memory allocated when only an
object is created.
EXAMPLE PROGRAM :
#include <iostream>
using namespace std;
class person
{
public:
string name;
int number;
};
int main()
{
person obj;
cout<<"Enter the Name :";
cin>>obj.name;
cout<<"Enter the Number :";
cin>>obj.number;
cout << obj.name<< obj.number;
}
Output :
Enter the name : baabtra
Enter the number:123
baabtra123
INHERITANCE
 Deriving new class from existing class.
 Object of one class contains the
property of another class.
 Reusability.
 We can add features to an
existing class without modifying it.
TYPES OF INHERITANCE
• Single Inheritance
• Hierarchical Inheritance
• Multi Level Inheritance
• Hybrid Inheritance
• Multiple Inheritance
SINGLE INHERITANCE
• One derived class inherits
from only one base class
• Most simplest form of
Inheritance.
EXAMPLE
#include<iostream>
using namespace std;
class father
{
public:
string name;
int age,pincode;
};
class child:public father
{
public:
string school;
int standard;
};
main()
{
father obj1;
child obj2;
cout<<"enter the name of father:";
cin>>obj1.name;
cout<<"enter the age of father:";
cin>>obj1.age;
cout<<"enter the pincode of father:";
cin>>obj1.pincode;
cout<<"-------------DETAIL OF CHILD--------------n";
cout<<"enter the name of child:";
cin>>obj2.name;
cout<<"enter the age of child:";
cin>>obj2.age;
cout<<"enter the pincode of child:";
cin>>obj2.pincode;
cout<<"enter the school name of child:";
cin>>obj2.school;
cout<<"enter the standard of child:";
cin>>obj2.standard;
}
HEIRARCHICAL INHERITANCE
• More than one derived
classes is derived from
common base class.
EXAMPLE
#include<iostream>
using namespace std;
class user
{
public:
string name,place;
int age;
};
class student:public user
{
public:
int rollno,classs,mark1,mark2;
};
class teacher:public user
{
public:
string department;
int teacher_id,salary;
};
main()
{
user obj;
student obj1;
teacher obj2;
cout<<"-----------------STUDENT-------------n";
cout<<"enter the name:";
cin>>obj1.name;
cout<<"enter the age:";
cin>>obj1.age;
cout<<"enter the place:";
cin>>obj1.place;
cout<<"enter the rollno:";
cin>>obj1.rollno;
cout<<"enter the class:";
cin>>obj1.classs;
cout<<"enter the mark1:";
cin>>obj1.mark1;
cout<<"enter the mark2:";
cin>>obj1.mark2;
cout<<"---------------TEACHER---------------n";
cout<<"enter the name:";
cin>>obj2.name;
cout<<"enter the age:";
cin>>obj2.age;
cout<<"enter the place:";
cin>>obj2.place;
cout<<"enter the id:";
cin>>obj2.teacher_id;
cout<<"enter the salary:";
cin>>obj2.salary;
cout<<"enter the department:";
cin>>obj2.department;
}
MULTI LEVEL INHERITANCE
• Derived class is derived
from another derived class.
EXAMPLE
#include<iostream>
using namespace std;
class grandparent
{
public:
void gshow()
{
cout<<"intelligent";
}
};
class parent:public grandparent
{
public:
void pshow()
{
cout<<"nhandsom";
}
};
class child:public parent
{
public:
void cshow()
{
cout<<"nobedience";
}
};
main()
{
grandparent obj1;
parent obj2;
child obj3;
cout<<"QUALITY OF GRANDPAn";
obj1.gshow();
cout<<"nQUALITIES OF FATHERn";
obj2.gshow();
obj2.pshow();
cout<<"nQUALITIES OF CHILDn";
obj3.gshow();
obj3.pshow();
obj3.cshow();
}
HYBRID INHERITANCE
• Combination of single
Inheritance , hierarchical
inheritance and
multi level inheritance.
EXAMPLE
#include<iostream>
using namespace std;
class grandparent
{
public:void gshow()
{
cout<<"nintelligent";
}
};
class parent:public grandparent
{
public:
void pshow()
{
cout<<"neducated";
}
};
class son:public parent
{
public:
void sshow()
{
cout<<"nobedience";
}
};
class daugter:public parent
{
public:
void dshow()
{
cout<<"nbeautiful";
}
};
main()
{
grandparent gobj;
parent pobj;
son sobj;
daugter dobj;
cout<<"QUALITY OF GRANDPA";
gobj.gshow();
cout<<"nQUALITY OF PARENT";
pobj.gshow();
pobj.pshow();
cout<<"nQUALITIES OF SON";
sobj.sshow();
sobj.pshow();
sobj.gshow();
cout<<"nQUALITIES OF DAUGHTER";
dobj.dshow();
dobj.pshow();
dobj.gshow();
}
MULTIPLE INHERITANCE
• Derived class is derived
from more than one
base class.
EXAMPLE
#include<iostream>
using namespace std;
class father
{
public:
void fshow()
{
cout<<"discipline";
}
};
class mother
{
public:
void mshow()
{
cout<<"nopen minded";
}
};
class child:public father,public mother
{
public:
void cshow()
{
cout<<"nintelligent";
}
};
main()
{
father obj1;
mother obj2;
child obj3;
cout<<"QUALITY OF FATHERn";
obj1.fshow();
cout<<"n";
cout<<"nQUALITY OF MOTHER";
obj2.mshow();
cout<<"n";
cout<<"nQUALITIES OF CHILDn";
obj3.fshow();
obj3.mshow();
obj3.cshow();
}
Disclaimer: This presentation is prepared by trainees of
baabtra as a part of mentoring program. This is not official
document of baabtra –Mentoring Partner
Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd
Follow us @ twitter.com/baabtra
Like us @ facebook.com/baabtra
Subscribe to us @ youtube.com/baabtra
Become a follower @ slideshare.net/BaabtraMentoringPartner
Connect to us @ in.linkedin.com/in/baabtra
Give a feedback @ massbaab.com/baabtra
Thanks in advance
www.baabtra.com | www.massbaab.com |www.baabte.com
Emarald Mall (Big Bazar Building)
Mavoor Road, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550
NC Complex, Near Bus Stand
Mukkam, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550
Cafit Square,
Hilite Business Park,
Near Pantheerankavu,
Kozhikode
Start up Village
Eranakulam,
Kerala, India.
Email: info@baabtra.com
Contact Us

More Related Content

PPTX
Inheritance
Siddhesh Palkar
 
PPT
9781111530532 ppt ch10
Terry Yoast
 
PPTX
Jafferjees
mahnoorzmalik
 
PDF
Fórmulas y funciones básicas: descripción, sintaxis y ejercicios de aplicación.
Giovanni Andres
 
PPTX
20.4 Java interfaces and abstraction
Intro C# Book
 
PPS
Inheritance
Ashish Awasthi
 
PPTX
Inheritance
Guntur Sulaeman
 
PPTX
Me326ppt
ccatalfamo
 
Inheritance
Siddhesh Palkar
 
9781111530532 ppt ch10
Terry Yoast
 
Jafferjees
mahnoorzmalik
 
Fórmulas y funciones básicas: descripción, sintaxis y ejercicios de aplicación.
Giovanni Andres
 
20.4 Java interfaces and abstraction
Intro C# Book
 
Inheritance
Ashish Awasthi
 
Inheritance
Guntur Sulaeman
 
Me326ppt
ccatalfamo
 

Viewers also liked (17)

PPT
Lec 45.46- virtual.functions
Princess Sam
 
PPTX
Hybrid Inheritance in C++
Abhishek Pratap
 
DOCX
Laporan PBO Pratikum 3
rahmi wahyuni
 
PPT
Harmonic and Other Sequences
stephendy999
 
PPTX
OOP C++
Ahmed Farag
 
PPT
Functions in c++
Maaz Hasan
 
PPT
Lec 42.43 - virtual.functions
Princess Sam
 
PPTX
ARITHMETIC MEAN AND SERIES
Darwin Santos
 
PPTX
Functions in C++
home
 
DOCX
Virtual function
harman kaur
 
ODP
Arithmetic, geometric and harmonic progression
Dr. Trilok Kumar Jain
 
PPT
Inheritance in c++ ppt (Powerpoint) | inheritance in c++ ppt presentation | i...
cprogrammings
 
PPTX
functions of C++
tarandeep_kaur
 
PPTX
Inheritance
Sapna Sharma
 
PPT
16 virtual function
Docent Education
 
PPT
pointers, virtual functions and polymorphisms in c++ || in cpp
gourav kottawar
 
PPTX
07. Virtual Functions
Haresh Jaiswal
 
Lec 45.46- virtual.functions
Princess Sam
 
Hybrid Inheritance in C++
Abhishek Pratap
 
Laporan PBO Pratikum 3
rahmi wahyuni
 
Harmonic and Other Sequences
stephendy999
 
OOP C++
Ahmed Farag
 
Functions in c++
Maaz Hasan
 
Lec 42.43 - virtual.functions
Princess Sam
 
ARITHMETIC MEAN AND SERIES
Darwin Santos
 
Functions in C++
home
 
Virtual function
harman kaur
 
Arithmetic, geometric and harmonic progression
Dr. Trilok Kumar Jain
 
Inheritance in c++ ppt (Powerpoint) | inheritance in c++ ppt presentation | i...
cprogrammings
 
functions of C++
tarandeep_kaur
 
Inheritance
Sapna Sharma
 
16 virtual function
Docent Education
 
pointers, virtual functions and polymorphisms in c++ || in cpp
gourav kottawar
 
07. Virtual Functions
Haresh Jaiswal
 
Ad

Similar to Inheritance in C++ (20)

PPTX
Inheritance
SangeethaSasi1
 
PPTX
Inheritance in c++theory
ProfSonaliGholveDoif
 
PPTX
Inheritance
Burhan Ahmed
 
PPTX
inheriTANCE IN OBJECT ORIENTED PROGRAM.pptx
urvashipundir04
 
PPTX
inheritance in OOPM
PKKArc
 
PPTX
Inheritance.pptx
Tansh5
 
PPTX
Introduction to inheritance and different types of inheritance
huzaifaakram12
 
PPTX
INHERITANCE, POINTERS, VIRTUAL FUNCTIONS, POLYMORPHISM.pptx
DeepasCSE
 
PPSX
Inheritance and Polymorphism in Oops
LalfakawmaKh
 
PPTX
Inheritance
prabhat kumar
 
PPTX
Inheritance in c++
VishnuSupa
 
PPTX
Inheritance.pptx
RutujaTandalwade
 
PPTX
Aryan's pres. entation.pptx
mohitsinha7739289047
 
PPTX
Ritik (inheritance.cpp)
RitikAhlawat1
 
PPT
MODULE2_INHERITANCE_SESSION1.ppt computer
ssuser6f3c8a
 
PDF
OOP Assign No.03(AP).pdf
Anant240318
 
PPTX
INHERITANCES.pptx
VISHNU PRIYA NR
 
PPTX
Oopc (group 9)
Xyber Prince
 
Inheritance
SangeethaSasi1
 
Inheritance in c++theory
ProfSonaliGholveDoif
 
Inheritance
Burhan Ahmed
 
inheriTANCE IN OBJECT ORIENTED PROGRAM.pptx
urvashipundir04
 
inheritance in OOPM
PKKArc
 
Inheritance.pptx
Tansh5
 
Introduction to inheritance and different types of inheritance
huzaifaakram12
 
INHERITANCE, POINTERS, VIRTUAL FUNCTIONS, POLYMORPHISM.pptx
DeepasCSE
 
Inheritance and Polymorphism in Oops
LalfakawmaKh
 
Inheritance
prabhat kumar
 
Inheritance in c++
VishnuSupa
 
Inheritance.pptx
RutujaTandalwade
 
Aryan's pres. entation.pptx
mohitsinha7739289047
 
Ritik (inheritance.cpp)
RitikAhlawat1
 
MODULE2_INHERITANCE_SESSION1.ppt computer
ssuser6f3c8a
 
OOP Assign No.03(AP).pdf
Anant240318
 
INHERITANCES.pptx
VISHNU PRIYA NR
 
Oopc (group 9)
Xyber Prince
 
Ad

More from baabtra.com - No. 1 supplier of quality freshers (20)

PPTX
Agile methodology and scrum development
baabtra.com - No. 1 supplier of quality freshers
 
PDF
Acquiring new skills what you should know
baabtra.com - No. 1 supplier of quality freshers
 
PDF
Baabtra.com programming at school
baabtra.com - No. 1 supplier of quality freshers
 
PDF
99LMS for Enterprises - LMS that you will love
baabtra.com - No. 1 supplier of quality freshers
 
PPTX
Chapter 6 database normalisation
baabtra.com - No. 1 supplier of quality freshers
 
PPTX
Chapter 5 transactions and dcl statements
baabtra.com - No. 1 supplier of quality freshers
 
PPTX
Chapter 4 functions, views, indexing
baabtra.com - No. 1 supplier of quality freshers
 
PPTX
Chapter 3 stored procedures
baabtra.com - No. 1 supplier of quality freshers
 
PPTX
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
baabtra.com - No. 1 supplier of quality freshers
 
PPTX
Chapter 1 introduction to sql server
baabtra.com - No. 1 supplier of quality freshers
 
PPTX
Chapter 1 introduction to sql server
baabtra.com - No. 1 supplier of quality freshers
 
Agile methodology and scrum development
baabtra.com - No. 1 supplier of quality freshers
 
Acquiring new skills what you should know
baabtra.com - No. 1 supplier of quality freshers
 
Baabtra.com programming at school
baabtra.com - No. 1 supplier of quality freshers
 
99LMS for Enterprises - LMS that you will love
baabtra.com - No. 1 supplier of quality freshers
 
Chapter 6 database normalisation
baabtra.com - No. 1 supplier of quality freshers
 
Chapter 5 transactions and dcl statements
baabtra.com - No. 1 supplier of quality freshers
 
Chapter 4 functions, views, indexing
baabtra.com - No. 1 supplier of quality freshers
 
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
baabtra.com - No. 1 supplier of quality freshers
 
Chapter 1 introduction to sql server
baabtra.com - No. 1 supplier of quality freshers
 
Chapter 1 introduction to sql server
baabtra.com - No. 1 supplier of quality freshers
 

Recently uploaded (20)

PPTX
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PPTX
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
PDF
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 

Inheritance in C++

  • 3. CONTENTS • CLASS BASE CLASS DERIVED CLASS • OBJECT • INHERITANCE SINGLE INHERITANCE MULTIPLE INHERITANCE HIERARCHICAL INHERITANCE MULTILEVEL INHERITANCE HYBRID INHERITANS(Virtual Inheritance)
  • 4. CLASS • Class is the base design of objects means expanded concept of a data, that can hold both data and functions. • No memory is allocated when class is created. • It is a user defined data type. Example : A car is consider as a class Methods : Engine, wheels, steering. Properties : company, model, colour, speed, etc….
  • 5. BASE CLASS • The class from which the subclass is derived is called a superclass (also a base class or a parent class). DERIVED CLASS • A class that is derived from another class is called a subclass (also a derived class, extended class, or child class).
  • 6. OBJECT • Object is the instance of class, means identifiable entity with some characteristics and behaviour. • Memory allocated when only an object is created.
  • 7. EXAMPLE PROGRAM : #include <iostream> using namespace std; class person { public: string name; int number; }; int main() { person obj; cout<<"Enter the Name :"; cin>>obj.name; cout<<"Enter the Number :"; cin>>obj.number; cout << obj.name<< obj.number; } Output : Enter the name : baabtra Enter the number:123 baabtra123
  • 8. INHERITANCE  Deriving new class from existing class.  Object of one class contains the property of another class.  Reusability.  We can add features to an existing class without modifying it.
  • 9. TYPES OF INHERITANCE • Single Inheritance • Hierarchical Inheritance • Multi Level Inheritance • Hybrid Inheritance • Multiple Inheritance
  • 10. SINGLE INHERITANCE • One derived class inherits from only one base class • Most simplest form of Inheritance.
  • 11. EXAMPLE #include<iostream> using namespace std; class father { public: string name; int age,pincode; }; class child:public father { public: string school; int standard; }; main() { father obj1; child obj2; cout<<"enter the name of father:"; cin>>obj1.name; cout<<"enter the age of father:"; cin>>obj1.age; cout<<"enter the pincode of father:"; cin>>obj1.pincode; cout<<"-------------DETAIL OF CHILD--------------n"; cout<<"enter the name of child:"; cin>>obj2.name; cout<<"enter the age of child:"; cin>>obj2.age; cout<<"enter the pincode of child:"; cin>>obj2.pincode; cout<<"enter the school name of child:"; cin>>obj2.school; cout<<"enter the standard of child:"; cin>>obj2.standard; }
  • 12. HEIRARCHICAL INHERITANCE • More than one derived classes is derived from common base class.
  • 13. EXAMPLE #include<iostream> using namespace std; class user { public: string name,place; int age; }; class student:public user { public: int rollno,classs,mark1,mark2; }; class teacher:public user { public: string department; int teacher_id,salary; }; main() { user obj; student obj1; teacher obj2; cout<<"-----------------STUDENT-------------n"; cout<<"enter the name:"; cin>>obj1.name; cout<<"enter the age:"; cin>>obj1.age; cout<<"enter the place:"; cin>>obj1.place; cout<<"enter the rollno:"; cin>>obj1.rollno; cout<<"enter the class:"; cin>>obj1.classs; cout<<"enter the mark1:"; cin>>obj1.mark1; cout<<"enter the mark2:"; cin>>obj1.mark2; cout<<"---------------TEACHER---------------n"; cout<<"enter the name:"; cin>>obj2.name; cout<<"enter the age:"; cin>>obj2.age; cout<<"enter the place:"; cin>>obj2.place; cout<<"enter the id:"; cin>>obj2.teacher_id; cout<<"enter the salary:"; cin>>obj2.salary; cout<<"enter the department:"; cin>>obj2.department; }
  • 14. MULTI LEVEL INHERITANCE • Derived class is derived from another derived class.
  • 15. EXAMPLE #include<iostream> using namespace std; class grandparent { public: void gshow() { cout<<"intelligent"; } }; class parent:public grandparent { public: void pshow() { cout<<"nhandsom"; } }; class child:public parent { public: void cshow() { cout<<"nobedience"; } }; main() { grandparent obj1; parent obj2; child obj3; cout<<"QUALITY OF GRANDPAn"; obj1.gshow(); cout<<"nQUALITIES OF FATHERn"; obj2.gshow(); obj2.pshow(); cout<<"nQUALITIES OF CHILDn"; obj3.gshow(); obj3.pshow(); obj3.cshow(); }
  • 16. HYBRID INHERITANCE • Combination of single Inheritance , hierarchical inheritance and multi level inheritance.
  • 17. EXAMPLE #include<iostream> using namespace std; class grandparent { public:void gshow() { cout<<"nintelligent"; } }; class parent:public grandparent { public: void pshow() { cout<<"neducated"; } }; class son:public parent { public: void sshow() { cout<<"nobedience"; } }; class daugter:public parent { public: void dshow() { cout<<"nbeautiful"; } }; main() { grandparent gobj; parent pobj; son sobj; daugter dobj; cout<<"QUALITY OF GRANDPA"; gobj.gshow(); cout<<"nQUALITY OF PARENT"; pobj.gshow(); pobj.pshow(); cout<<"nQUALITIES OF SON"; sobj.sshow(); sobj.pshow(); sobj.gshow(); cout<<"nQUALITIES OF DAUGHTER"; dobj.dshow(); dobj.pshow(); dobj.gshow(); }
  • 18. MULTIPLE INHERITANCE • Derived class is derived from more than one base class.
  • 19. EXAMPLE #include<iostream> using namespace std; class father { public: void fshow() { cout<<"discipline"; } }; class mother { public: void mshow() { cout<<"nopen minded"; } }; class child:public father,public mother { public: void cshow() { cout<<"nintelligent"; } }; main() { father obj1; mother obj2; child obj3; cout<<"QUALITY OF FATHERn"; obj1.fshow(); cout<<"n"; cout<<"nQUALITY OF MOTHER"; obj2.mshow(); cout<<"n"; cout<<"nQUALITIES OF CHILDn"; obj3.fshow(); obj3.mshow(); obj3.cshow(); }
  • 20. Disclaimer: This presentation is prepared by trainees of baabtra as a part of mentoring program. This is not official document of baabtra –Mentoring Partner Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd
  • 21. Follow us @ twitter.com/baabtra Like us @ facebook.com/baabtra Subscribe to us @ youtube.com/baabtra Become a follower @ slideshare.net/BaabtraMentoringPartner Connect to us @ in.linkedin.com/in/baabtra Give a feedback @ massbaab.com/baabtra Thanks in advance www.baabtra.com | www.massbaab.com |www.baabte.com
  • 22. Emarald Mall (Big Bazar Building) Mavoor Road, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 NC Complex, Near Bus Stand Mukkam, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 Cafit Square, Hilite Business Park, Near Pantheerankavu, Kozhikode Start up Village Eranakulam, Kerala, India. Email: [email protected] Contact Us