next up previous contents
Next: 5.7 Increment and Decrement Up: 5 Data TypesOperations, Previous: 5.5.4 Characters

5.6 Assignment Operators and Expressions

The basic assignment operator is =. The following statement adds 2 to the value of a.

    a = a + 2;

The abbreviated form

    a += 2;

could also be used to perform the same operation.

All of the following binary operators can be used in this fashion:

+   -   *   /   %   <<   >>   &   ^   |



Fred G. Martin
Fri Mar 29 17:44:15 EST 1996