C Reference Cheat Sheet Page 13

ADVERTISEMENT

C Reference Cheat Sheet
by
Ashlyn Black
via
Binary Operators (cont)
C Cheatsheet by Ashlyn Black
Bitwise inclusive-OR of a and b. (a ⋃ b)
a | b;
Logical AND. True if both a and b are non-zero. (Logical
a && b;
AND) (a ⋂ b)
Logical OR. True if either a or b are non-zero. (Logical OR) (a
a || b;
⋃ b)
Ternary & Assignment Operators
by descending evaluation precedence
Evaluates a if x evaluates as true or b otherwise. (if(x){ a;
x ? a : b;
} else { b; })
Assigns value of a to x.
x = a;
Assigns product of a and b to a. (a = a × b)
a *= b;
Assigns quotient of dividend a and divisor b to a. (a = a ÷
a /= b;
b)
Assigns remainder of integers dividend a and divisor b to
a %= b;
a. (a = a mod b)
Assigns sum of a and b to a. (a = a + b)
a += b;
Assigns difference of a and b to a. (a = a - b)
a -= b;
Assigns left bitwise shift of a by b places to a. (a = a ×
a <<= b;
b
2 )
Assigns right bitwise shift of a by b places to a. (a = a ×
a >>= b;
-b
2 )
Assigns bitwise AND of a and b to a. (a = a ⋂ b)
a &= b;
Assigns bitwise exclus​ i ve-OR of a and b to a. (a = a ⊕ b)
a ^= b;
Assigns bitwise inclus​ i ve-OR of a and b to a. (a = a ⋃ b)
a |= b;
By Ashlyn Black
Published 28th January, 2015.
Sponsored by
Last updated 20th April, 2015.
Measure your website readability!
Page 13 of 13.

ADVERTISEMENT

00 votes

Related Articles

Related forms

Related Categories

Parent category: Education