What has possibly gone wrong? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

What has possibly gone wrong?

enum{dead=0,alive}; struct Person { private: int state; public: Person(){state=alive;} //This gave no errors though... string name; string address; void kill(){state=dead;} ~Person(){} //This returns an error... };

3rd Apr 2017, 11:45 AM
Kinshuk Vasisht
Kinshuk Vasisht - avatar
5 Answers
+ 4
Please Help!!!
3rd Apr 2017, 11:45 AM
Kinshuk Vasisht
Kinshuk Vasisht - avatar
+ 3
Use class instead of struct. OOP concepts can be better learned and implemented using class
3rd Apr 2017, 12:07 PM
देवेंद्र महाजन (Devender)
देवेंद्र महाजन (Devender) - avatar
+ 3
@Dennis Forgot that here...😅
3rd Apr 2017, 12:10 PM
Kinshuk Vasisht
Kinshuk Vasisht - avatar
+ 3
Thanks, everyone
3rd Apr 2017, 12:10 PM
Kinshuk Vasisht
Kinshuk Vasisht - avatar
+ 1
Try a semicolon after the struct :)
3rd Apr 2017, 11:56 AM
Dennis
Dennis - avatar