+ 2
Why the output is 7.How it is executed???
check this code https://code.sololearn.com/cfvk9hVaBQJS/?ref=app
3 Answers
+ 1
It is called post incrementing. First assign the value to q and then increments it.
+ 3
int i = 7 will create int variable with value of 7
and *q is pointer variable.
doing q = &i; will assign *q with address of i.
now on printf("%d", *q++);
will print the value of at address stored in q.
using q++ will print the value first and then it will increase the value.
so the output is 7.
+ 1
It shows 7 because '++' after the variable executes after, if you want to execute it before you should use '++' before the variable.



