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
Pointers are just numbers, representing addresses in memory. You can add to and subtract from pointers, for instance. It is pretty easy to make mistakes with pointer math, however,

Why many companies are switching their current business language to PHP? Where PHP basically used? PHP is rapidly gaining popularity and numerous companies are switching their

padovan string program 1 : package test.padovanstring; public class PadovanString {     public int stringOccurrences(int n, String str){        if(n >= 40)     return -


Automatic Variables Automatic variables are variable which are explained within the functions. They lose their value when the function terminates. It can be accessed only in th

write a C program for padovan string for a natural number   program 1 : package test.padovanstring; public class PadovanString {     public int stringOccurrences(int n,

t 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 these

how we write decision tables, flowcharts,pseudocode,and algorithm in result management system

how do you declare an integer variable