+ 2

How to make an abstract class?

18th Nov 2016, 4:27 PM
Waseem Siddiqi
Waseem Siddiqi - avatar
2 Answers
+ 1
declare a member function as a pure virtual function, for example in C++ class Animal{ Animal(){} void sound() = 0; //this is a pure virtual member function, it must be implemented in all derived classes }
18th Nov 2016, 7:50 PM
Rill Chritty
Rill Chritty - avatar
0
in above also make sound() protected or public member function.
18th Nov 2016, 7:52 PM
Rill Chritty
Rill Chritty - avatar