Operators are symbols that act on values (operands) to produce a result. C has arithmetic (+ - * / %), relational (< == >=), logical (&& || !), assignment (= +=), increment (++ --), bitwise (& | ^ ~ << >>), the conditional operator ?:, and sizeof. Precedence and associativity decide the order in which they run.
Bitmasks live here.
The bitwise pages teach the set/clear/toggle/test patterns behind flags and bitmasks, the same ideas used in drivers, protocols, and permission systems.
Path
Learning Path
Work through the stages in order, or jump to a topic from the index below (10 tutorials).
if (x = 5) assigns and is always true. Use == to compare.
prec
Trusting precedence you have not memorized
a & b == c parses as a & (b == c). Add parentheses when mixing operator families.
side
Side effects in one expression
i = i++ + ++i; is undefined behavior. Modify a variable once between sequence points.
Remember
Key Takeaways
Group: operators fall into a few families.
Parentheses: use them to show intent.
Bits:&, |, ^, and shifts power flags and masks.
One line: Operators are symbols that act on values (operands) to produce a result.
Frequently Asked Questions
C has roughly 45 operators across arithmetic, relational, logical, bitwise, assignment, conditional, pointer, member-access, comma, and sizeof categories.
= assigns a value; == compares two values and yields 1 or 0.
See the bitwise operators and bit manipulation techniques pages for flags, set/clear/toggle, and bit counting.