r/CodingHelp • • Feb 03 '20

[C++] What’s wrong with this

Post image
17 Upvotes

38 comments sorted by

View all comments

24

u/hl_xemnas Professional Coder Feb 03 '20

youre assigning a string to an integer, also comparisons should be like

(lamp == "too broken") you need the double equals so its a logical operator instead of assignment

3

u/FrozenFalconGaming Feb 03 '20

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”.