Go Down

Topic: compiler should notice... (Read 1 time) previous topic - next topic

Gabe462

when I use the wrong operator...

if (fishyTasteInMouth = true)     // accidentally used = instead of ==

Gabe

admin

#1
May 19, 2006, 12:57 pm Last Edit: May 19, 2006, 12:59 pm by admin Reason: 1
no...:)



that's perfectly valid in C... maybe not desireable but valid ;)

usually I tell my students to use
if (true == FishyTasteInMouth) ....

so if by mistake you use = the compiler will complain


massimo

Go Up