Click here to Skip to main content
15,890,882 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
why is their a "=0" at the end of the method declaration?

class GamePiece { public: virtual std::unique_ptr<gamepiece> clone() const= 0; };

What I have tried:

why is their a "=0" at the end of the method declaration?

class GamePiece { public: virtual std::unique_ptr<gamepiece> clone() const= 0; };
Posted
Updated 17-Dec-18 23:11pm
v3
Comments
Patrice T 17-Dec-18 19:05pm    
there is no 'a =0' in this code !
[no name] 17-Dec-18 19:15pm    
It says. class GamePiece { public: virtual std::unique_ptr<gamepiece> clone() const= 0; };
CPallini 18-Dec-18 3:19am    
Could you please post the whole code here?
(Modify the original post).
Richard MacCutchan 18-Dec-18 5:12am    
Same help vampire as yesterday.

It is a pure virtual function. A class is abstract if it has at least one pure virtual function. A pure virtual function is declared by assigning 0 in declaration. Read more Pure Virtual Functions and Abstract Classes in C++[^]
 
Share this answer
 
v2
I told you the answer yesterday, and suggested (yet again) that you stop wasting your time posting questions here and actually studied the C++ language.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900