GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Notizen

Virtual, Friend and Static Function

Rushabh Ostwal Object Oriented Programming Englisch 1 Seite

Inhalt der Notizen (1)

Seite 1

What is Virtual Function? How can you access this function using pointer? Explain with example.

Virtual means existing in appearance but not in reality. Polymorphism refers to the property by which objects belonging are able to respond to the same message, but in different forms.

When we use the same function name in both the classes, the function in the base class is declared as virtual using the keyword virtual preceding it's normal declaration. C++ requires pointers to objects to use the virtual function.

Example :-

#include<iostream>

Informationen

Beschreibung
Object Oriented Programming Notiz am Virtual, Friend and Static Function, erstellt von Rushabh Ostwal am 09/05/2017.
Erstellt von
Rushabh Ostwal
Aufrufe
1
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck