Can somebody give me the reason why the integer i is not getting incremented.
Here is the code:
main()
{
int i=10;
i=i++;
printf("%d",i);
}
and the output is 10.
Here my doubt is that, i know that i is post incremented. Eventhough i is not incremented at the time of assignment, i should get incremented after that instruction(post incrementation) ie the printf statement should print the incremented value as in the below example
{
int i=j=10;
i=j++;
printf("%d %d",i,j);
}
here the output is 10 11. and i kno the reason that i gets the value before the increment and j is incremented(post incremented) after the completion of the instruction.
My question is y the same thing is not happening in the previous example
Waiting for your valuble explanations..
Thanks