#include <stdio.h>
int main() {
int c[6] = { 10,20,30,40,50,60 }, * p, * s;
p = c; s = &c[5];
printf("%d\n", s - p);
}
地址相减最后的结果为什么不是20
#include <stdio.h>
int main() {
int c[6] = { 10,20,30,40,50,60 }, * p, * s;
p = c; s = &c[5];
printf("%d\n", s - p);
}
地址相减最后的结果为什么不是20
结果不可能是20的,结果应该是5,因为s和p都是指针,print打印的为指针之间的差值,几位移量5-0等于5!望采纳!