Is this undefined behavior??

Discussion in 'C++' started by saurabh29789, Jun 6, 2009.

  1. saurabh29789

    saurabh29789 Guest

    Here is a C++ code snippet :

    {
    int i = 10;

    ++i = 2;

    }


    Would the statement 2 invoke UB ??

    PS : I think yes, it should, because i is being changed twice between
    2 consecutive sequence points.
    saurabh29789, Jun 6, 2009
    #1
    1. Advertising

  2. Bart van Ingen Schenau, Jun 6, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. aka
    Replies:
    10
    Views:
    692
  2. REH
    Replies:
    25
    Views:
    821
    Victor Bazarov
    Mar 29, 2005
  3. Mantorok Redgormor
    Replies:
    70
    Views:
    1,734
    Dan Pop
    Feb 17, 2004
  4. VK
    Replies:
    45
    Views:
    581
    Dr John Stockton
    Sep 12, 2006
  5. -Lost
    Replies:
    13
    Views:
    359
    Richard Cornford
    Jan 31, 2007
Loading...

Share This Page