|
发表于 2023-3-19 12:03:30
|
显示全部楼层
本楼为最佳答案
这是标准的说法
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.
When an expression that has integer type is added to or subtracted from a pointer, the result has thetype of the pointer operand. If the pointer operand points to an element of an array object, and thearray is large enough, the result points to an element offset from the original element such that thedifference of the subscripts of the resulting and original array elements equals the integer expression.In other words, if the expression P points to the i-th element of an array object, the expressions(P)+N (equivalently, N+(P)) and (P)-N (where N has the value n) point to, respectively, the i + n-thand i − n-th elements of the array object, provided they exist. Moreover, if the expression P points tothe last element of an array object, the expression (P)+1 points one past the last element of the array object, and if the expression Q points one past the last element of an array object, the expression(Q)-1 points to the last element of the array object.
怀疑是书上有问题 |
|