4 ms·
The same as above, only using Pointer Arithmetic instead of Array Subscripting: *(array + index) == *(index + array) Further broken down: *(&array[0]
by dgallagher 16y ago
The same as above, only using Pointer Arithmetic instead of Array Subscripting:
*(array + index) == *(index + array)
Further broken down:
*(&array[0] + index) == *(index + &array[0])
- jallmann 16y agoYep. And if teaching that to a bunch of middle or high schoolers, I would add that pointer arith works in increments of sizeof(array[0]) bytes. If you're not careful about operator precedence in moderately complicated expressions, that could come back to bite you.