How to analyse the precedence in following situation .
for (i=0; i<20; i++)
{
*array_p++ = i*i;
printf(\"%d\\n\",*arr++);
}
how
Citing Wikipedia, postfix ++ binds before unary *. This means that you have *(arr++). For example, in the expression *arr++ = 5, *arr is assigned to 5, then arr is incremented.
In the K&R, this trick is used to write a concise version of memcpy. It's something like:
while (--size)
*dest++ = *src++;
I'll post the correct example after I get home tonight.
Edit: Apparently, only postfix ++ has higher precedence. Wikipedia says prefix ++ has equal precedence.