C++两地址相减结果,该如何解决

C++两地址相减结果
Int  v[10];
&v[5]-&v[3]的结果为什么是2,不是8?
------解决思路----------------------
百度搜索
指针算术 或者 指针运算 
好好补课
------解决思路----------------------
&v[x]的类型是int *,从3到5就2个整数,当然是2了,你要的8是 (char *)&v[5]-(char *)&v[3]
------解决思路----------------------
指针运算
http://blog.****.net/zhangxiangdavaid/article/details/38146449
------解决思路----------------------
是计算两个地址之间元素的个数,而不是字节的个数
------解决思路----------------------
计算的结果是相差的元素位置(个数),不是具体字节数,因为一般关心的是位置
------解决思路----------------------
2表示相差2个元素。

------解决思路----------------------
Pointer Arithmetic
Additive operations involving a pointer and an integer give meaningful results only if the pointer operand addresses an array member and the integer value produces an offset within the bounds of the same array. When the integer value is converted to an address offset, the compiler assumes that only memory positions of the same size lie between the original address and the address plus the offset.

This assumption is valid for array members. By definition, an array is a series of values of the same type; its elements reside in contiguous memory locations. However, storage for any types except array elements is not guaranteed to be filled by the same type of identifiers. That is, blanks can appear between memory positions, even positions of the same type. Therefore, the results of adding to or subtracting from the addresses of any values but array elements are undefined.

Similarly, when two pointer values are subtracted, the conversion assumes that only values of the same type, with no blanks, lie between the addresses given by the operands.

------解决思路----------------------
(char*)&v[5] - (char*)&v[3]结果会变成8