If they had made it const that wouldn't have happened.
Assignment, equivalency, those are the same riiiiight?
Exactly!
Now this guy gets it!
Or just enabled modern compiler warnings.
"Or just used a real language." -- C++ hater
if(isCrazyMuderingRobot = true)
Not sure what that language is (java?) but the conditional check looks like an affectation to me, which should lead to nothing at all (compilation error)
Besides I'm not sure how that ";" after kill(humans) would work right before an else without brackets...
It looks like C code to me. That part should compile just fine with C or C++, but although the compiler gives you a warning these days it allows you to confuse assignments with comparisons. The expression will read the value from the left side of the assignment in the evaluation. Sometimes it's convenient to do that to get some things done (Python added the walrus operator to let you do it safely), but it's usually a mistake.
(post is archived)