typedef struct AbcStruct{
short LD;
short EL;
short CL;
AbcStruct( short b, short res = 0, short lr = 1000): LD( b ), EL(res), CL( lr ) { }
};
int main ()
{
struct AbcStruct A2(200, 100, 100);
char *string_ptr = (char *)&A2;
kk = sizeof(AbcStruct);
while(kk--)
printf(" %x ", *string_ptr++);
}
输出(十六进制的 AbcStruct):
ffffffc8 0 64 0 64 0
我想知道为什么第一个元素的输出包含 4 个字节:ffffffc8
当我期待它只会 print c8
。
谢谢