Skip to content

Conversation

@CTLJ99
Copy link

@CTLJ99 CTLJ99 commented Jul 11, 2016

No description provided.

Clarke Littlejohn

1) if i recall correctly ++*P moves the pointer then gets the values, *p++ get the value in the point the increments it
and *++p is not an apoerator that works.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The expression ++*p has two operators of same precedence, so compiler looks for associativity. Associativity of operators is right to left. Therefore the expression is treated as ++(*p). The expression *p++ is treated as *(p++) as the precedence of postfix ++ is higher than *. The expression *++p has two operators of same precedence, so compiler looks for associativity. Associativity of operators is right to left. Therefore the expression is treated as *(++p).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants