Skip to content

Assignment 7, totally on time, Eli Kalish#21

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

Assignment 7, totally on time, Eli Kalish#21
elik723 wants to merge 1 commit intoCPRO-Session1:masterfrom
elik723:master

Conversation

@elik723
Copy link
Copy Markdown

@elik723 elik723 commented Jul 11, 2016

No description provided.

@@ -0,0 +1,21 @@
1. Explain the difference between ++*p, *p++ and *++p, if there is any.
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