So, I played in increments of C, and I ran this code
int main() {
int a = 3;
int b = 8;
b = a++;
printf("%d %d",a, b);
return 1;
}
Initially, I thought, oh yes, it’s easy ... Therefore, I thought that it would print 3 and 3.
This is due to the fact that ++ is an increment by mail and increases the value after it has been used in this function. Answer instead
a=4
b=3
I do not understand how post increment a is added before the function completes, i.e. printf instructions.
Can someone explain why the answer is what it is.
thank
source
share