Tripod C Now
Operators
November 25, 1999
John's home page

C Operators
OperatorOperands Description PrecedenceAssociativity
()
2  Function call 15Left to Right
[]
2  Selection of Array element 15Left to Right
.
2  Selection of member of structure or union 15Left to Right
->
2  Selection of member of pointed to structure or union 15Left to Right
!
1  Logical NOT 14Right to Left
-
1  Sign change 14Right to Left
++
1  Increment 14Right to Left
--
1  Decrement 14Right to Left
&
1  Reference 14Right to Left
*
1  Dereference 14Right to Left
(type)
1  Type cast 14Right to Left
*
2  Multiplication 13Left to Right
/
2  Division 13Left to Right
%
2  Remainder 13Left to Right
+
2  Addition 12Left to Right
-
2  Subtraction 12Left to Right
~
2  Bitwise NOT 12Left to Right
<<
2  Left shift 11Left to Right
>>
2  Right shift 11Left to Right
<
2  Less than 10Left to Right
>
2  Greater than 10Left to Right
<=
2  Less than or equal to 10Left to Right
>=
2  Greater than or equal to 10Left to Right
==
2  Equal to 9Left to Right
!=
2  Not equal to 9Left to Right
&
2  Bitwise AND 8Left to Right
^
2  Bitwise exculsive OR 7Left to Right
|
2  Bitwise OR 6Left to Right
&&
2  Logical AND 5Left to Right
||
2  Logical OR 4Left to Right
?:
3  Conditional evaluation 3Right to Left
=
2  Assignment 2Right to Left
*=
2  Multiplication assignment 2Right to Left
/=
2  Division assignment 2Right to Left
%=
2  Remainder assignment 2Right to Left
+=
2  Addition assignment 2Right to Left
-=
2  Subtraction assignment 2Right to Left
<<=
2  Left Shift assignment 2Right to Left
>>=
2  Multiplication assignment 2Right to Left
&=
2  Bitwise AND assignment 2Right to Left
^=
2  Bitwise exclusive OR assignment 2Right to Left
|=
2  Bitwise OR assignment 2Right to Left
,
2  Sequence 1Left to Right


C Now C Reference Index
C Now Home Page