|
|
|
|
|
by clarry
3461 days ago
|
|
No, he isn't correct. > They also have a provision where a pointer to a nonarray value is treated as if it were a 1-element array That is not what it says. Let me quote the exact words (emphasis mine): For the purposes of these operators, a pointer to an object that is not an element of an array behaves the same as a pointer to the first element of an array of length one with the type of the object as its element type. You're right that what we have is obviously (a pointer to) an array object, not an element of another array. This is precisely the case where this special provision kicks in, and thus it is legal to do &arr + 1. |
|