- The most common usage
of the comma operator is
in the
for-statement
where you need to
initialize multiple index
variables
- Example:
- Write a for-loop that
copies
A[0], A[1], ..., A[9] to
B[10], B[11], ..., B[19],
respectively
|
Answer:
for ( i = 0 , j = 10; i < 10; i++, j++ )
B[j] = A[i];
|
|