+ 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