1.

Which is the correct syntax of defining a pure virtual function?(a) pure virtual return_type func();(b) virtual return_type func() pure;(c) virtual return_type func() = 0;(d) virtual return_type func();I got this question at a job interview.The origin of the question is Abstract Classes in portion Derived Classes, Templates & Exception Handling in C++ of C++

Answer» RIGHT answer is (C) VIRTUAL return_type func() = 0;

Easiest explanation - virtual return_type function_name(PARAMETERS) = 0; where {=0} is called pure specifier.


Discussion

No Comment Found

Related InterviewSolutions