Kamis, 26 Januari 2017

How to make a pointer direct to derived class in C++ Programming

A base class pointer can point to a derived class object. But, a derived class pointer can never point to a base class object. Following program demonstrates object slicing using a base class pointer: One of the main advantages of object oriented programming is reusability. Using already existing code is known as reusability. C++ supports reusability through inheritance which is creating a new class from already existing class.   Inheritance is defined as deriving properties and behavior from one class to another class. The existing class from which properties and behavior are derived is known as a base class or

The post How to make a pointer direct to derived class in C++ Programming appeared first on Coding Security.


How to make a pointer direct to derived class in C++ Programming
read more

Tidak ada komentar:

Posting Komentar