Introduction to Inheritance in c++





This video tutorial explains  the concept of inheritance in c++.
You will learn what is inheritance, what is the use of inheritance, how to implement inheritance in c++, how to create derived classes, what is a base class, how to inherit from a class in detail with example.

source code for this tutorial

#include 
#include
using namespace std;

class Person{
public:
    string name;
    int age;
    void setName(string iname){name = iname;}
    void setAge(int iage){age = iage;}

};

class Student : public Person{
public:
    int id;
    void setId(int iid){id = iid;}

    void introduce(){
    cout <<"hi iam "<
                  
Back To Top