Startertutorials Blog
Tutorials and articles related to programming, computer science, technology and others.
Subscribe to Startertutorials.com's YouTube channel for different tutorial and lecture videos.

Pure Virtual Function Program in C++

Categories: Inheritance. No Comments on Pure Virtual Function Program in C++

In this article we will learn how to implement a pure virtual function program in C++. A C++ program is provided to illustrate the concept of pure virtual function and calculate the area of different shapes by using abstract class. Program is as follows: #include <iostream> using namespace std; class Shape { public: virtual void […]

Read the rest of this entry »

CPP program to show how constructors are invoked in derived class

Categories: Inheritance. No Comments on CPP program to show how constructors are invoked in derived class

In this article we will try to implement a CPP program to show how constructors are invoked in derived class. A C++ program is given below to demostrate how constructors are invoked in derived class.   Program is as follows: #include <iostream> using namespace std; class A { protected: int x; public: A(int p) { […]

Read the rest of this entry »

CPP program to illustrate the order of execution of constructors and destructors in inheritance

Categories: Inheritance. No Comments on CPP program to illustrate the order of execution of constructors and destructors in inheritance

In this article we will learn to implement a CPP program to illustrate the order of execution of constructors and destructors in inheritance. A C++ program is provided below to demonstrate in which order constructors and destructors are executed in inheritance.   Program is as follows: #include <iostream> using namespace std; class A { public: […]

Read the rest of this entry »