Summary

C has many operators, such as the assignment and arithmetic operators discussed in this chapter. In general, an operator operates on one or more operands to produce a value. Operators that take one operand, such as the minus sign and sizeof, are termed unary operators. Operators requiring two operands, such as the addition and the multiplication operators, are called binary operators.

Expressions are combinations of operators and operands. In C, every expression has a value, including assignment expressions and comparison expressions. Rules of operator precedence help determine how terms are grouped when expressions are evaluated. When two operators share an operand, the one of higher precedence is applied first. If the operators have ...

Get C Primer Plus, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.