Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
virtual function and virtual inheritence
#1
what is the difference between virual function and virtual inheritence

The purpose of virtual inheritence is to make behaviour of class like it direct base class.as in private inheritence only direct derived class can access the data members and functions.and in public,protected inheritence we can go deep in herarichy.
Reply
#2
With virtual functions, derived classes can provide new implementations of functions from their base classes. When someone calls a virtual function of an object of the derived class, this new implementation is called, even if the caller uses a pointer to the base class, and doesn't even know about the particular derived class.

Virtual inheritance is a type of inheritance in which the part of the object that belongs to virtual base class becomes common direct base class for derived class and any other class that derives from it. Virtual inheritance is used in multiple inheritance.

0300-9520262
Get solution in 24 hour
|cpmputer & internetConfusedmileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  why we use inline function if there are simple function available, or what is the spa Vuhelper 0 21,978 05-31-2012, 01:51 AM
Last Post: Vuhelper
  Default Function Argument with example Vuhelper 0 13,328 05-31-2012, 01:47 AM
Last Post: Vuhelper
  What is the difference among calloc function ,malloc function and recalloc function? Vuhelper 0 34,589 05-31-2012, 01:46 AM
Last Post: Vuhelper
  What is Function Overloading in C++ Vuhelper 0 5,399 05-31-2012, 01:45 AM
Last Post: Vuhelper
  offline function in C++ Vuhelper 0 3,624 05-31-2012, 01:42 AM
Last Post: Vuhelper
  i take input from getchar(); function in program in C++ 2012 Vuhelper 0 2,992 05-31-2012, 01:40 AM
Last Post: Vuhelper
  how we used the 1-calloc Function 2- malloc Function 3- free () 4- realloc Function i Vuhelper 1 31,140 05-31-2012, 01:35 AM
Last Post: Vuhelper
  What are the function of IO ports in C++ Vuhelper 0 3,599 05-31-2012, 01:27 AM
Last Post: Vuhelper
  Argc(argument count) and argv(argument value) are used in main function Vuhelper 0 2,029 01-04-2012, 10:42 PM
Last Post: Vuhelper
  stack during function call in C++ 2011 Vuhelper 0 2,025 11-05-2011, 05:05 PM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 1 Guest(s)