What is the difference between virtual functions and pure virtual functions?



What is the difference between virtual functions and pure virtual functions?..

Answer / hrpynux@gmail.com

A virtual function is a member function of base class which can be redefined by derived class. A pure virtual function is a member function of base class whose only declaration is provided in base class and should be defined in derived class otherwise derived class also becomes abstract.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ Interview Questions

What is a constructor initializer list?

0 Answers   Amazon,


How to generate random numbers in C++ with a range?

0 Answers  


What does it mean to declare a member function as static in C++?

0 Answers   Amazon,


What are pass by value and pass by reference?what is the disadvantage of pass by value?

0 Answers   Alter,


Briefly explain various access specifiers in C++.

0 Answers   Amdocs,






What are the advantages/disadvantages of using #define?

0 Answers   Amazon,


Declare a pointer to a function that takes a char pointer as argument and returns a void pointer.

0 Answers   Alter,


How can a C function be called in a C++ program?

0 Answers  


Name the operators that cannot be overloaded.

1 Answers   Wipro,


Explain encapsulation in C++.

0 Answers   Verifone,


How does stack look in function calls? Write a recursive function call, how will the stack look like?

0 Answers   Adobe,


How do you write a function that can reverse a linked-list in C++?

0 Answers   IBS,


Categories