What does it mean to declare a member function as a virtual, C/C++ Programming

What does it mean to declare a

1.      member function as a virtual

A:

(a) C++ virtual function is member function of any class, whose functionality may be over- ridden in its derived classes. The entire function body might be replaced along with a new set of implementation in derived class. The concept of c++ virtual functions is distinct from C++ Function overloading. The difference among a virtual member function and a non-virtual c++ member function is, the non-virtual member functions are determined at compile time. This mechanism is called as static binding. Whereas the c++ virtual member functions are determined during run-time. This mechanism is called as dynamic binding.

 

 

Posted Date: 3/21/2013 7:36:41 AM | Location : United States







Related Discussions:- What does it mean to declare a member function as a virtual, Assignment Help, Ask Question on What does it mean to declare a member function as a virtual, Get Answer, Expert's Help, What does it mean to declare a member function as a virtual Discussions

Write discussion on What does it mean to declare a member function as a virtual
Your posts are moderated
Related Questions
a) Define an Asset base class that provides the following method: class Asset { public:      virtual double getValue()=0; };   This will be the base class for both stock an

input marks of c and c++ if c grater than equal to 50 grater than 50 you are pass if c greater than equal to 50 c++ less than 50 than supplementry c++ if c less then 50 and c++ gra

Raj is a newbie to the programming and while learning the programming language he came to know the following rules: · Each program must start with ''{'' and end with ''}''. Ã

Write a ''C'' program to accept any 3 digit integer number from the keyboard and display the word equivalent representation of the given number.


Can any constructor throw an exception? How to handle error while the constructor fails?

flowchart of c programing to check the given number is prime or not


Determine the types of Container class Container class can be of 2 types: - Heterogeneous container - Here container class comprise a group of mixed objects - Homogeneou