Changes

Jump to: navigation, search

Objective-C Operators and Expressions

508 bytes added, 14:35, 8 October 2009
no edit summary
As with the arithmetic operators, each bitwise operator has a corresponding compound operator that allows the operation and assignment to be performed using a single operator:
 
<table border="1" cellspacing="0">
<tr style="background:#efefef;">
<th>Operator</th><th>Description</th>
<tr>
<td>x &= y<td>Perform a bitwise AND of x and y and assign result to x</td>
<tr>
<td>x |= y<td>Perform a bitwise OR of x and y and assign result to x</td>
<tr>
<td>x ^= y<td>Perform a bitwise XOR of x and y and assign result to x</td>
<tr>
<td>x <<= n<td>Shift x left by n places and assign result to x</td>
<tr>
<td>x >>= n<td>Shift x right by n places and assign result to x</td>
</tr>
</table>

Navigation menu