代码示例:
#include <stdio.h>
int main()
{
int arr[10] = { 0,1,2,3,4,5,6,7,8,9 };
int* p = arr;
int sz = sizeof(arr) / sizeof(arr[0]);
int i = 0;
for (i = 0; i < sz; i++)
{
printf("%d-------%p\n", arr[i], &arr[i]);
}
return 0;
}
运行结果:
0-------012FFA94
1-------012FFA98
2-------012FFA9C
3-------012FFAA0
4-------012FFAA4
5-------012FFAA8
6-------012FFAAC
7-------012FFAB0
8-------012FFAB4
9-------012FFAB8