Demonstration of inheritance in C++

Demonstration of inheritance in c++.
This example contains the following files.

  • VEHICLE.H
  • VEHICLE.CPP
  • ALLVEHIC.CPP
  • CAR.H
  • CAR.CPP
  • TRANSPORT.CPP
  • TRUCK.H
  • TRUCK.CPP

Vehicle.h is a basic class for a vehicle. Car, truck and allvehicle will be inherited from this base class. All the common features of a vehicle are kept in the base class i.e weight, # of wheels etc…

Derived classes will have the veicle properties and methods as well as their own properties and methods.

  Demonstration of inheritance (2.8 KiB, 8,439 hits)

M. Saqib: Saqib is Master-level Senior Software Engineer with over 14 years of experience in designing and developing large-scale software and web applications. He has more than eight years experience of leading software development teams. Saqib provides consultancy to develop software systems and web services for Fortune 500 companies. He has hands-on experience in C/C++ Java, JavaScript, PHP and .NET Technologies. Saqib owns and write contents on mycplus.com since 2004.
Related Post