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

Does improper inheritance have a potential to wreck a project?

0 Answers  


Explain bubble sorting.

0 Answers  


What will strcmp("Astring", "Astring"); return a) A positive value b) A negative value c) Zero

0 Answers  


List the issue that the auto_ptr object handles?

0 Answers  


Write a program to concatenate two strings.

0 Answers  






What is your strongest programming language (Java, ASP, C, C++, VB, HTML,C#, etc.)?

24 Answers   Infosys, Microsoft, TCS,


What is the stack?

5 Answers   IBM, ICICI,


How static variables and local variablesare similar and dissimilar?

0 Answers  


What are c++ variables?

0 Answers  


Is it legal in c++ to overload operator++ so that it decrements a value in your class?

0 Answers  


What are the advantages of using const reference arguments in a function?

0 Answers  


How to get the current position of the file pointer?

0 Answers  


Categories