#include <stdio.h>
int main(void) {
int TEST_HB[10];
memset(TEST_HB,'9', sizeof( TEST_HB));
printf("%c\n",TEST_HB[9]);
printf ("TEST_HB[10]=%d\n",sizeof( TEST_HB[40])); // shows 4
printf ("Arraysize=%d\n",(sizeof(int)*10)); // gets the expectected results
return 0;
}
我相信 sizeof (myArray) 应该以字节为单位返回数组的总大小。但是为什么sizeof( TEST_HB[40])
在没有定义的时候返回 4 呢?