In 2007, the original title, without "revisited", was posted on this forum.
It was only a two line program, initializing x, and then printing it using either x++ or ++x. I believed there should have been a third line to show what x becomes after line 2. Here's my sample program:
Code:
#include <stdio.h>
int main (void)
{ int x;
x = 0;
printf("1: First x: X = %d\n" , x);
printf("2: Using x++, X = %d\n" , x++);
printf("3: Final x: X = %d\n" , x);
x = 0;
printf("1: First x: X = %d\n" , x);
printf("2: Using ++x, X = %d\n" , ++x);
printf("3: Final x: X = %d\n" , x);
return(0);
}
And here is the result:
1: First x: X = 0
2: Using x++, X = 0
3: Final x: X = 1
1: First x: X = 0
2: Using ++x, X = 1
3: Final x: X = 1
Now it's clear that x transitions from 0 to 1 in both cases.