标签:内存对齐 地址 #pragma packn
#include<stdio.h> //#include<string.h> #pragma pack(8) struct A { char c; //1byte double d; //8byte short s; //2byte int i; //4byte }; int main() { A strua; printf("%d\n",sizeof(A)); printf("%d,%d,%d,%d\n",&strua.c,&strua.d,&strua.s,&strua.i); return 0; }
标签:内存对齐 地址 #pragma packn
原文地址:http://blog.csdn.net/fujinlong520/article/details/46389115