What are virtual functions in c++, C/C++ Programming

A virtual function permits derived classes to replace the implementation given by the base class. The compiler makes sure the replacement is always known as whenever the object in question is actually of the derived class, even if the object is accessed by a base pointer rather than a derived pointer. This permits algorithms in the base class to be replaced in the derived class, even if users don't know about the derived class.                

 

 

Posted Date: 4/8/2013 5:52:24 AM | Location : United States







Related Discussions:- What are virtual functions in c++, Assignment Help, Ask Question on What are virtual functions in c++, Get Answer, Expert's Help, What are virtual functions in c++ Discussions

Write discussion on What are virtual functions in c++
Your posts are moderated
Related Questions

Polymorphism C++ supports this idea - that different objects do "the right thing "- by function polymorphism and class polymorphism. Poly means many, while morph means form.

Define Register Storage Class - computer programming? The Storage class register notify the compiler that the associated variables must be stored in high-speed memory register.

C Program for SWAPPING THE STRING #include conio.h> #include stdio.h> void main() {           char a[50],temp=0;           int i=0,c=0,c1=0,l=0;           clr

Develop a C++ program that uses a while to determine the gross pay (in Dollars) for each of several employees. The company pays “straight-time” for the first 40 hours worked by ea


Most first graders know that nine hundred and ninety nine plus one is one thousand, but C++ doesn't! Sure, a computer can easily compute 999 + 1 and get 1000. But reading and writi

Aim: Write a program of multipication using inline function class Multiply {           int x,y;           public:           void getdata();           inline calc

write an algorithm for linear search algorithm

This is a test program that tests the Student and ITECH7603Class classes.     In this assignment you are provided with three input text files associated with this program: