|
|
|
|
|
by hnfairy
3461 days ago
|
|
Despite the argument at the end, this is undefined behavior in the latest C specification. The code dereferences a pointer one past the last element. C11 6.5.6/8: If the result points one past the last element of the array object, it shall not be used as the operand of a unary * operator that is evaluated |
|
he doesn't use the * operator on it, he just calculates its position. If he were to access it (ie, use it with *) then that would be breaking the rule