How to create a pure virtual function?

Answer Posted / hrpynux@gmail.com

You declare a pure virtual function by using a pure specifier ( = 0 ) in the declaration of a virtual member function in the class declaration. Class A is an abstract class. The compiler would not allow the function declarations A g() or void h(A) , declaration of object a , nor the static cast of b to type A .

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Reverse the Linked List. Input: 1->2->3->4->5->NULL Output: 5->4->3->2->1->NULL

444


Is c++ a programming language?

680


What is a flag in c++?

710


Is python better than c++?

664


Explain one-definition rule (odr).

757






What is a stack? How it can be implemented?

789


Show the declaration for a pointer to function returning long and taking an integer parameter.

666


What are the vectors in c++?

668


Define the operators that can be used with a pointer.

661


What is jump statement in C++?

701


Why the usage of pointers in C++ is not recommended ?

982


What is c++ flowchart?

782


Write about an iterator class?

694


Why do we need c++?

689


Explain the use of virtual destructor?

706