What is pure virtual function?



What is pure virtual function?..

Answer / Jay Govind Singh

A pure virtual function is a function in a class that has no implementation. It serves as a contract for derived classes to implement their versions of the function.n Pure virtual functions are declared using `= 0` after the return type.n Example: `class Shape { public: virtual void draw() = 0; };`

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

What is data type in c++?

1 Answers  


what is data abstraction in C++?

1 Answers  


what is scupper?

1 Answers  


Explain the difference between c++ and java.

1 Answers  


When is a template a better solution than a base class?

1 Answers  


write the programme that convert a interger to biniry number

1 Answers   Amazon,


What is the average salary of a c++ programmer?

1 Answers  


What is the insertion operator and what does it do?

1 Answers  


What is a singleton class c++?

1 Answers  


What is the difference between a class and a structure in C++?

1 Answers  


Write a C++ program which will compute the volume of a sphere or a cylinder after prompting the user to type the first character for the shape name.

0 Answers   An-Najah National University,


What do you mean by inheritance in c++?

1 Answers  


Categories