+ 2
C++ : pure virtual function
Why do we need pure virtual functions when we can have empty body functions {}
1 Answer
+ 11
PURE VIRTUAL FUNCTION is declared as :
Eg: virtual return_type function_name(function argument)=0;
The =0 tells the compiler that function has no body this virtual function will be called Pure virtual Function.
https://stackoverflow.com/questions/15075581/c-difference-between-virtual-0-and-empty-function