I have the following code,
main()
{
char *p="abc";
int x;
x=++*p++;
printf("%d",x);
}
My question is, when I try to do x=++*p++, the program crashes. If my associativity rules are right, first the address pointed to by p should be incremented by the postfix (p++) and then the value (*p) should be applied, and thereafter the prefix operator should be used. Why did it not give a compiler error saying lvalue required?
As, when the compiler first does *p++, it is retrieving the value of the address pointing to by p. (As per my understanding).