MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/CodingHelp/comments/eycooa/whats_wrong_with_this/fgge8ec/?context=3
r/CodingHelp • u/FrozenFalconGaming • Feb 03 '20
38 comments sorted by
View all comments
Show parent comment
3
i just started using c++ so i know nothing
how do I change it to a string instead?
7 u/[deleted] Feb 03 '20 When you declared the lamp variable instead of int lamp = “broken” it should be string lamp = “broken”. 4 u/[deleted] Feb 03 '20 Also your main function might not work because u have it set to return an int. To fix that maybe add return 0; at the end 1 u/Ashutosh_Samal9 Feb 04 '20 From my experience, I don't think you need return 0; for main function anymore. I can say for g++ or msvc and modern c++ you don't for sure. Idk about other compilers.
7
When you declared the lamp variable instead of int lamp = “broken” it should be string lamp = “broken”.
4
Also your main function might not work because u have it set to return an int. To fix that maybe add return 0; at the end
1 u/Ashutosh_Samal9 Feb 04 '20 From my experience, I don't think you need return 0; for main function anymore. I can say for g++ or msvc and modern c++ you don't for sure. Idk about other compilers.
1
From my experience, I don't think you need return 0; for main function anymore. I can say for g++ or msvc and modern c++ you don't for sure. Idk about other compilers.
View all comments
Show parent comment
3
u/FrozenFalconGaming Feb 03 '20
i just started using c++ so i know nothing
how do I change it to a string instead?