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
plaese tell the full program for the above given topic with the input and output

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

switch statement

Question 1 Describe the theory behind class templates and function templates along with relevant programming examples Question 2 With the help of suitable programming example

The program must use the file named on the command line as its input file. Suppose the program is named pdbtool. Then if the user types pdbtool 1A36.pdb the program must read the d

What about Virtual Destructor? describe it.

C++ Multiplayer Game Programming Project Project Description: We are seeking an experienced C++ Game Programmer to enhance clientside related aspects of MCS: Mars City Securi

Here is a short program. It prints out the value of a variable "x". Ernie and Bert disagree about what will be printed: Ernie says, the value gets changed in "changeX" so it will p

Should my constructors employ "assignment" or "initialization lists"?

Define the Char Data Type of C Language? The char defines characters. The char type will usually require only 1 byte of internal storage. Every char type has an equivalent inte