#include "stdio.h" #include "iostream" int main() { char s[]="123456789"; char d[]="123"; strcpy(d,s); int a[]={1,2,3,4,5}; printf("%s,%s,%d",d,s,sizeof(a)); return 0; }
可以看出,不同数组的地址是按 从高到低的顺序给数组的首地址的。即越后面的数组的首地址越低。(5c+14(十六机制)=70)
#include "stdio.h" #include "iostream" int main() { char s[]="123456789"; char d[]="123"; strcpy(d,s); int a[]={1,2,3,4,5}; printf("%s,%s,%d",d,s,sizeof(a)); return 0; }