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

Which operator cannot overload?

543


Do you know what are pure virtual functions?

640


Is c# written in c++?

521


Which programming language is best?

554


What does catch(…) mean?

612






Difference between strdup and strcpy?

650


What is the use of register keyword with the variables?

549


Define whitespace in C++.

757


Which c++ operator cannot overload?

553


What is scope in c++ with example?

632


Carry out conversion of one object of user-defined type to another?

616


What do the header files usually contains?

632


Are iterators pointers?

679


Explain storage qualifiers in c++.

621


What is the use of c++ programming language in real life?

567