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
For Loop with inner loop

There are so many different concepts related with OOP (Object-oriented programming) such as: Class Object Inheritance Polymorphism Abstraction Encapsulation

palindrome program with minimum character replacements


Write a program that counts from 0 to 99 and prints these numbers to the terminal ie it prints 00, 01, 02, 03, 04, 05, ....,99. Graphics 1. Write a program in rPeANUt that

write a program that counts the number of occurances of the string in the n-th padovan string p(n)

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

I am seeking an expert to create a 360 degree virtual tour in KRPano for use on PCs, tablets and smartphones. You will be given with panoramas in order to create an advanced KRPano

What is the difference between JavaScript and PHP? The difference lies with the execution of languages. PHP is server side scripting language, which means that it cannot intera

There are two ways for initializes in C++ as shown in the example that follows. The first way uses the traditional C notation. The second way uses constructor notation. int foo