How to create a pure virtual function?



How to create a pure virtual function?..

Answer / 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

More C++ General Interview Questions

What is the purpose of template?

0 Answers  


What are namespaces in c++?

0 Answers  


If a header file is included twice by mistake in the program, will it give any error?

0 Answers  


If there are 1 to 100 Numbers in array of 101 elements. Which is the easy way to find repeated number?

2 Answers   Persistent,


What is private, public and protected inheritance?

0 Answers  


Is c++ proprietary?

0 Answers  


Define a nested class.

0 Answers  


Can you pass a vector to a function?

0 Answers  


Is java a c++?

0 Answers  


How the delete operator differs from the delete[]operator?

0 Answers  


What are the various arithmetic operators in c++?

0 Answers  


how many rounds and wt type of questios ask in the written test for first round 2. tech. round 3. and futher rounds

0 Answers   Thought Works,


Categories