Skip to content

Add files via upload#9

Open
jy330545 wants to merge 1 commit intoCPRO-Session1:masterfrom
jy330545:master
Open

Add files via upload#9
jy330545 wants to merge 1 commit intoCPRO-Session1:masterfrom
jy330545:master

Conversation

@jy330545
Copy link
Copy Markdown

No description provided.

The difference between ++*P, *p++ and *++p is that:
++*P increases the value of *p by one
*p++ moves up the location of the pointer by one
*++p will do exactly what ++*p does
Copy link
Copy Markdown
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