C++ pure virtual functions related interiew questions and answers

C++ Pure Virtual Function.

What is a Pure Virtual Function?

- It is a virtual function that does not have any implementation part.
- It has only declaration part.
- It is declared by assigning the '0' in the declaration part.

Example:
class A
{
   public:
       virtual void pureVirtual() = 0;   // Pure Virtual Function
          // There is no function body
};

- This function is also known as, pure specifier.
- The "= 0" notation indicates that the virtual function is a pure virtual function and it has no function body or definition.
ATL Server interview questions and answers - ATL Server FAQ
What is Swing?, What is AWT?, What are the differences between Swing and AWT?, What are heavyweight components? What is lightweight component?
C++ Syntax questions
Questions on C++ Syntax - What are the Sizes and ranges of the Basic C++ data types?, What are the new features that ISO/ANSI C++ has added to original C++ specifications? etc.
What is a constructor?
What is a constructor? - Constructors allow initialization of objects at the time of their creation....
Post your comment
Discussion Board
C++
Pure virtual function
BhuraRam 12-4-2015

You may like