Skip to content

Conversation

@Mnd2126
Copy link

@Mnd2126 Mnd2126 commented Jul 10, 2016

No description provided.

7/7/16
Part 2 of Assignment7

1) ++*p increments the value of a pointer, and *p++ increments the address of a pointer. *++p is not valid, as it is incrementing invalidly.
Copy link
Contributor

Choose a reason for hiding this comment

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

`Hmm, not quite: 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