Operators that have a side effect

We are used to thinking of the four symbols   +   -   *   /   as the only operators.
But other symbols, such as   =   <<   >>   ++   --   are also operators.
This means that an entire statement such as

	i = j + k;
is actually one big expression, consisting of two operators (+ and =) and three operands (i, j, k).

Some operators do nothing more than compute a value.
An example is the + operator when applied to ints:                              y + x     10 + 20
Other operators also have side effects. For example,

  1. precedence2.C.
    * (multiplication, line 5) has higher precedence than = (assignment, line 16).
    * (multiplication line 5) has higher precedence than << (output, line 7).
    See lines 5, 16, and 7 of this table.
  2. associativity2.C.
    << (output, line 7) and >> (input, line 7) have left-to-right associativity.
    = (assignment, line 16) has right-to-left associativity. See lines 5, 7, and 16 of this table.
  3. assignment.C. The assignment operators:     +=     -=     *=     /=     etc.
  4. increment.C. The increment and decrement operators:     ++     --     (that’s two dashes)
    This is how the C++ language got its name: it’s a little better than the older language C.