Pages: [1]   Go Down
Author Topic: compiler should notice...  (Read 1006 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 24
Dont think like a computer, make it think like you
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

when I use the wrong operator...

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

Gabe
Logged

Forum Administrator
Offline Offline
Newbie
*****
Karma: 3
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

no...smiley



that's perfectly valid in C... maybe not desireable but valid smiley-wink

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

so if by mistake you use = the compiler will complain


massimo
« Last Edit: May 19, 2006, 05:59:39 am by admin » Logged

Pages: [1]   Go Up
Jump to: