Skip to content

Tag Archives: cpp-inheritance

Pre-requisites: Inheritance in C++, Multiple Inheritance in C++ In multiple inheritances, when one class is derived from two or more base classes then there may… Read More
Constructor is a class member function with the same name as the class. The main job of the constructor is to allocate memory for class… Read More
Constructor is a class member function with the same name as the class. The main job of the constructor is to allocate memory for class… Read More
Base Class: A base class is a class in Object-Oriented Programming language, from which other classes are derived. The class which inherits the base class… Read More
Object-oriented design started right from the moment computers were invented. Programming was there, and programming approaches came into the picture. Programming is basically giving certain… Read More
1. What is a pure virtual function? Ans. A pure virtual function (or abstract function) in C++ is a virtual function for which we don’t… Read More
There are certain situation when we want to make some of the public base class functions as private in the derived class. Suppose both base… Read More
Binding refers to the process of converting identifiers (such as variable and performance names) into addresses. Binding is done for each variable and functions. For… Read More
Prerequisite: Virtual Function in C++Calling virtual functions from a constructor or destructor is considered dangerous most of the times and must be avoided whenever possible.… Read More
A virtual function is a member function which is declared within a base class and is re-defined (overridden) by a derived class. When you refer… Read More
Prerequisite: Constructors Whenever we create an object of a class, the default constructor of that class is invoked automatically to initialize the members of the class. … Read More
TABLE OF CONTENT: Introduction Class Objects Encapsulation Abstraction Polymorphism Inheritance Dynamic Binding Message Passing Object-oriented programming – As the name suggests uses objects in programming.… Read More
Predict the output of the following simple C++ program without any virtual function. #include <iostream> using namespace std;    class Base { public:     void print()… Read More
Sometimes implementation of all function cannot be provided in a base class because we don’t know the implementation. Such a class is called abstract class.… Read More
A virtual function is a member function that is declared in the base class using the keyword virtual and is re-defined (Overriden) in the derived… Read More

Start Your Coding Journey Now!