This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/49679] Increment/decrement operator (++/--) not working as expected
- From: "jordan_2000 at hotmail dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 8 Jul 2011 18:32:59 +0000
- Subject: [Bug c++/49679] Increment/decrement operator (++/--) not working as expected
- Auto-submitted: auto-generated
- References: <bug-49679-4@http.gcc.gnu.org/bugzilla/>
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.