+ 3

How can we make a class abstract?

27th Apr 2017, 12:23 PM
Abdullah Zaigham
Abdullah Zaigham - avatar
4 Answers
+ 2
Add a pure virtual method: class Shape { public: virtual void Draw() = 0; }
27th Apr 2017, 1:16 PM
Igor B
Igor B - avatar
+ 2
Create a class with all pure virtual methods.
27th Apr 2017, 1:42 PM
shaldem
shaldem - avatar
+ 2
A class which has AT LEAST one pure virtual function is considered abstract. It can have all types of members and functions (non-pure-virtual too) except that one function must be pure virtual (so that it satisfies above condition).
27th Apr 2017, 4:20 PM
Norbivar
Norbivar - avatar
+ 2
Abstracr class with all pure virtual methods named interface.
27th Apr 2017, 4:32 PM
shaldem
shaldem - avatar