Precedence of Operators
PUMA'S REBL TAC
Alphabet Operators Operator Name Associativity
P () Function Call LEFT TO RIGHT
[] Array Subscript LEFT TO RIGHT
. Dot(member of structure) LEFT TO RIGHT
-> Arrow(member of structure) LEFT TO RIGHT
U ! Logical NOT RIGHT TO LEFT
~ One's complement RIGHT TO LEFT
- Unary Minus(negation) RIGHT TO LEFT
++ Increment RIGHT TO LEFT
-- Decrement RIGHT TO LEFT
& Address of RIGHT TO LEFT
* Indirection RIGHT TO LEFT
(type) Cast RIGHT TO LEFT
sizeof Sizeof RIGHT TO LEFT
M * Multiplication LEFT TO RIGHT
/ Division LEFT TO RIGHT
% Modulus(remainder) LEFT TO RIGHT
A + Addition LEFT TO RIGHT
- Subtraction LEFT TO RIGHT
'S << Left Shift LEFT TO RIGHT
>> Right Shift LEFT TO RIGHT
R < Less than LEFT TO RIGHT
<= Less than or equal to LEFT TO RIGHT
> Greater than LEFT TO RIGHT
>= Greater than or equal to LEFT TO RIGHT
E == Equal to LEFT TO RIGHT
!= Not Equal to LEFT TO RIGHT
B & Bitwise AND LEFT TO RIGHT
^ Bitwise XOR LEFT TO RIGHT
| Bitwise OR LEFT TO RIGHT
L && Logical AND LEFT TO RIGHT
|| Logical OR LEFT TO RIGHT
T ? : Conditional RIGHT TO LEFT
A =,+=,*=, etc Assignment Operator RIGHT TO LEFT
C , Comma LEFT TO RIGHT
Associativity of Operators
T(Ternary) ,A(Assignment) ,U(Unary) => Right to Left
P,M,A,S,R,E,B,L,C => Left to Right
0 Response to "Precedence & Associativity of Operators"
Post a Comment
If you have any doubts, please let me know...