http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47412
Summary: Output: x = 31 but y = 30
Product: gcc
Version: 4.4.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: [email protected]
ReportedBy: [email protected]
#include <stdio.h>
int main() {
int x, y;
x = 10;
x = 20 + x++;
printf("x = %d\n", x);
x = 10;
y = 20 + x++;
printf("y = %d\n", y);
return 0;
}
Output of above program:
x = 31
y = 30
x have to be 30
