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
Aim: To implement a program to allocate memory dynamically for 2 dimensional array (accept and print matrix) using pointers. Code:                       #include #inc

program for decode the encoded numbering format into message

At a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets with thes

Write a program that finds the minimum total number of shelves, including the initial one required for this loading process.

Get Reverse Engineer to Linux game routine analysis Project Description: I want a fast and efficient reverse engineer with good knowledge of assembly x86 language, strong rev

Estimation of the yield curve using nonlinear least squares minimization: The last part of this assignment asks you to construct the Nelson Siegel yield curve from observed bond pr

write the program to accept date and to say valid or invalid

What are the debugging methods you employ while came across a problem? A: Debugging with tools such as: 1.      DBG, GDB ,Forte, Visual Studio. 2.      Using tusc to trace

Virtual Functions The keyword virtual was previously used to resolve ambiguity for a class derived from two classes, both having a common ancestor. These classes are known as v

Question: (a) (i) Explain how class members can be accessed when using objects of the class. Use a suitable example to illustrate your answer. (ii) Explain how the privat