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
decoding message

#solution for decode the code for smuglers

WAP TO PRINT ANY NAME ON SCREEN 10 TIMES void main () { int a=1; clrscr(); do { printf ("expertsmind\n"); a++; } while (a getch (); }

Compiler Design - Limit In The Method Instructions

Exceptions. Your SVector class should throw four exceptions: 3.1. If the constructor size is invalid, then it will just allow the implicit STL bad_alloc exception to pass up to mai

Define Polymorphism? A: Polymorphism let a client to treat di_erent objects in the simialr way even if they were developed from di_erent classes and exhibit di_erent behaviors.

Control Flow The control flow statements are used when it is needed that the flow of the program is to be changed after taking some decision. This control flow statement theref


A Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P(1) = ‘Y’ P(2) = ‘Z’ P(n) = P(n-2) + P(n-3), n>2 where + denotes string concatenation. For a string of t

Luminous Jewels - The Polishing Game Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various lum