C Operator Precedence

C, C++, Visual C++, C++.Net Topics
Post Reply
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

C Operator Precedence

Post by Neo » Mon Oct 05, 2009 3:31 am

COP.PNG
COP.PNG (28.84 KiB) Viewed 3558 times
Note 1:
Parentheses are also used to group expressions to force a different order of evaluation; such parenthetical expressions can be nested and are evaluated from inner to outer

Note 2:
Postfix increment/decrement have high precedence, but the actual increment or decrement of the operand is delayed (to be accomplished sometime before the statement completes execution). So in the statement y = x * z++; the current value of z is used to evaluate the expression (i.e., z++ evaluates to z) and z only incremented after all else is done.
User avatar
Laracroft
Posts: 2
Joined: Tue Nov 03, 2009 10:12 am

Re: C Operator Precedence

Post by Laracroft » Tue Nov 03, 2009 12:34 pm

Hi Neo,
This is Lara,
I found your information on C Operator Precedence very useful in my study.
If you have other information related to C programming, please post it so I can use it.
Ok Bye.
Post Reply

Return to “C/C++ Programming”