Wednesday, 6 April 2011

Mistakes you made in the Unit-II

  • Most of the students made a mistake that is                                                                                                'virtual function' ,                                                                                                                                           pure virtual function,                                                                                                                                 and virtual Base class. Here these three are different concepts but most of the students wrote the definition of virtual base class for pure virtual function and virtual function.
  • So read carefully about those concepts
  • I have given in this blog for 'pure virtual function, and virtual functions with program (classes and Inheritance) so note down that programs
  • Very a few students wrote correct definitions
  • I will post Unit II marks very soon
What is Virtual Function?

Ans: When derived class overrides the base class function by redefining the same function, then if user wants to access redefined the function from derived class through a pointer from base class object, then you must define this function in base class as virtual function.
/* see in this blog for syntax, program */

What is pure virtual function?

Pure virtual function is virtual function with no body is known as Pure Virtual function.
/* see in this blog for syntax, program */

What is virtual Base class?
Ans: /* see the notes */

No comments:

Post a Comment