你的数组定义和运行环境是什么,我测试了下两个是一样的啊
[root@db /home/clion]# cat main.c
#include <stdio.h>
void main(){
short data[512][512];
data[1][1] = 111;
printf("data[1][1] is %d.
", data[1][1]);
printf("*(&data[0][0]+513) is %d.
", *(&data[0][0]+513));
printf("address1 is %p
", &data[1][1]);
printf("address2 is %p
", &data[0][0] + 513);
}
[root@db /home/clion]# ./main
data[1][1] is 111.
*(&data[0][0]+513) is 111.
address1 is 0x7ffc0c9ff2a2
address2 is 0x7ffc0c9ff2a2
[root@db /home/clion]#
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…