This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/49679] Increment/decrement operator (++/--) not working as expected


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49679

--- Comment #3 from Jordan <jordan_2000 at hotmail dot de> 2011-07-08 18:32:55 UTC ---
I know the warnings, but look the code

    ....
    a+=++a+a++;
    b+=++b+b++;
    cout << "a=" << a << endl << "b=" << b << endl;

    cin >> a;
    ....

a and b must be the same.
if i remove

    cin >> a;

everything is ok.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]