Defining Awesome
  • Status Updates

  • Written by . Posted at 5:02 am on February 11th, 2010

    The most destructive and most easily misseen C++ mistake:
    if (foo = bar) {}
    instead of
    if (foo == bar) {}

    Be Sociable, Share!

    15 comments.

    1. Don’t you have an Idea which locates these problems and highlights them for you!?


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


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


    4. …ever heard of warning level 4?

      warning C4706: assignment within conditional expression


    5. good that flash develop is smart enough to find it and say what’s wrong.


    6. School boy error


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


    8. …ever heard of warning level 4?

      warning C4706: assignment within conditional expression

      Warnings are for pussies.
      :p


    9. Complaining about mistakes which are very easy to remedy is for pussies, too.


    10. The most destructive and most easily misseen coding mistake:

      Ignoring compiler warnings. 😀


    11. SYNTAX~~~~~~ERROR~~~~~~~~!!!!

      Top Of Page


    12. foo == bar
      instead of
      foo = bar

      is more annoying


    13. I love assignments and validations all on one line.
      int a, b;
      if( (a = 5) == b)
      { etc.. }


    14. : instead of ; is annoying :)


    15. …A error i make all time :$(i am newbie lol).No compilation error,just a bug in the program.


    Post a comment.

    Links