Changes

Objective-C Operators and Expressions

5 bytes added, 14:49, 7 October 2009
Compound Assignment Operators
== Compound Assignment Operators ==
In an earlier section we looked at the basic assignment operator (=). Objective-C# provides a number of operators designed to combine an assignment with a mathematical or logical operation. These are primarily of use when performing an evaluation where the result is to be stored in one of the operands. For example, one might write an expression as follows:
<pre>
</pre>
The above expression performs exactly the same task as ''x = x + y'' but saves the programmer some typing. This is yet another feature that C# has inherited from the C programming language.
Numerous compound assignment operators are available in Objective-C#. The most frequently used are outlined in the following table: