Virtual functions - Features,Properties - Polymorphism and Abstract Classes

Q.  Which of the followings are true about Virtual functions?
- Published on 17 Jul 15

a. They must be non-static member function of the class
b. They cannot be friends
c. Constructor Functions cannot be virtual
d. All of these

ANSWER: All of these
 

    Discussion

  • Nihal   -Posted on 06 Oct 15
    The important points about Virtual functions are as follows:
    • They must be non-static member function of the class.
    • They cannot be friends.
    • Constructor cannot be virtual but destructor can be virtual.
    • It is used for late binding or runtime binding.
    • The address of the virtual Function is placed in the VTABLE

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)