Selasa, 07 Maret 2017

How to create a virtual functions in C++ Programming

We know that when a base class pointer refers to a derived class object, the extra features in derived class are not available. To access the extra features in the derived class, we make the functions in the base class as virtual. High End Applications need virtual Functions,Syntax for creating a virtual function is as follows: 1 2 3 4 5 virtual return–type function–name(params–list) { //Body of function ... }   A class which contains one or more virtual functions is known as a polymorphic class. Following program demonstrates accessing derived class features using virtual functions: 1 2 3 4

The post How to create a virtual functions in C++ Programming appeared first on Coding Security.


How to create a virtual functions in C++ Programming
read more

Tidak ada komentar:

Posting Komentar