OOPs

Limitations on Constructors and Destructors in C++

Limitations on Constructors and Destructors in C++ Limitations on Constructors:- The following are the limitations on constructor functions. Constructor functions should be declared in the public section of the class.  Private and Protected constructors are available only to the member functions and friends of that class. A constructor function does not have any return type, …

Limitations on Constructors and Destructors in C++ Read More »

Polymorphism in C++

Polymorphism in C++ Polymorphism refers to “One Object Many Forms”. It is one of the most important features of OOPs. Polymorphism is implemented through Overloaded operators and Overloaded functions. Polymorphism can be compile time polymorphism or runtime polymorphism. In C++, polymorphism is implemented through virtual functions and dynamic binding. Early binding refers that an object …

Polymorphism in C++ Read More »

Virtual function – Difference between a Virtual function and an Overloaded function

Virtual function Polymorphism is the property that allows objects of different types to behave differently to the same message. In C++, polymorphism is achieved through virtual functions. Whenever we define a function with the same name in the Base class as well as in the Derived class, the base class pointer, irrespective of pointing to …

Virtual function – Difference between a Virtual function and an Overloaded function Read More »

Virtual Base class

Virtual Base Class: A virtual base class is one that is specified as virtual when it is inherited.  If the base class definition precedes the keyword virtual, then it is referred to as virtual base class.  If a situation arises, where the data members of a base class are inherited more than once to a …

Virtual Base class Read More »

'inline' keyword

Advantage of using the keyword ‘inline’ before a function: The member functions of a class may be defined inside the class definition or outside the class using scope resolution operator. The functions defined inside a class are inline by default. Generally, the functions, which are small, are defined inside a class definition. If a function …

'inline' keyword Read More »

You cannot copy content of this page.