December 2013
Beginner
576 pages
16h 4m
English
At the bottom of the precedence totem pole, so to speak, is the comma operator. In Chapter 5, we pointed out that inside a for statement, you can include more than one expression in any of the fields by separating each expression with a comma. For example, the for statement that begins
for ( i = 0, j = 100; i != 10; ++i, j -= 10 ) ...
initializes the value of i to 0 and j to 100 before the loop begins, and it increments the value of i and subtracts 10 from the value of j after the body of the loop is executed.
Because all operators in Objective-C produce a value, the value of the comma operator is that of the rightmost expression.
Read now
Unlock full access