The most destructive and most easily misseen C++ mistake:
if (foo = bar) {}
instead of
if (foo == bar) {}
Written by MM. Posted at 5:02 am on February 11th, 2010
15 comments.
Post a comment.
Don’t you have an Idea which locates these problems and highlights them for you!?
I did that ALL THE TIME when learning programming. I’d be like “There’s NOTHING wrong with my code, why won’t it compile!?”, now I’ve almost turned it into a habbit.
Tell me about it. This is actually one of those that are hard as hell to find. Luckily C# compiler doesn’t let this happen.
…ever heard of warning level 4?
warning C4706: assignment within conditional expression
good that flash develop is smart enough to find it and say what’s wrong.
School boy error
Heh, man that was an annoying mistake when i was learning C for a semester last year, compiler wouldnt pick it up, it would simply not work. That’s when debugging line by line became useful, well, atleast with the small simple programs we were doing, i’d imagine there’re more effective ways to pick it up with larger programs.
…ever heard of warning level 4?
warning C4706: assignment within conditional expression
Warnings are for pussies.
:p
Complaining about mistakes which are very easy to remedy is for pussies, too.
The most destructive and most easily misseen coding mistake:
Ignoring compiler warnings. 😀
SYNTAX~~~~~~ERROR~~~~~~~~!!!!
Top Of Page
foo == bar
instead of
foo = bar
is more annoying
I love assignments and validations all on one line.
int a, b;
if( (a = 5) == b)
{ etc.. }
: instead of ; is annoying
…A error i make all time :$(i am newbie lol).No compilation error,just a bug in the program.