摘要: 在C中如下结构:structfoo{charc1;shorts;charc2;inti;};假设结构成员在内存中紧凑排列,c1地址0,s地址应该是1,c2地址3,i地址4c100000000s00000001c200000003i00000004但VC6中#include<stdio.h>Struct foo{charc1;shorts;charc2;inti;};intmain(){structfooa;printf("c1\t%p\ns\t%p\nc2\t%p\ni\t%p\n",(unsignedint)(void*)&a.c1-(unsigned 阅读全文
posted @ 2012-09-08 23:31 乌托邦. 阅读(248) 评论(0) 推荐(0) 编辑