Hello guys after going through href=http://en.cppreference.com/w/c/language/operator_precedence this link ,
I thought I understood the operator precedence but I came to followings doubt.
The link says that When parsing an expression, an operator which is listed on some row will be bound tighter (as if by parentheses) to its arguments than any operator that is listed on a row further below it. For example, the expression *p++ is parsed as *(p++), and not as (*p)++.
So how does the expression ++*p gets evaluated is it like ++(*p) but if yes ++ has higher priority or bound then *, Then why does * is bound tighter in the above case, and what about the expression *++p ?
Operator precedence defines which operator should be applied first when there is more than one choice.
From your link:
Precedence and associativity are independent from order of evaluation.
The expression ++*p
, or any expression of the form:
{operator 2} {operator 1} {expression}
has a well-defined order of evaluation, where {operator 1} {expression}
must be applied in order to make an expression that {operator 2}
may act on.