sizeof(结构体/联合体)

来源:互联网 发布:2016年e道商城网络传销 编辑:程序博客网 时间:2024/05/22 14:18
#define COMBINE_STRUCT \
struct TTestStruct {double b;int c;}A


struct TTestStructD {
COMBINE_STRUCT;
int d;
int e;
int f;
};


// 嵌套结构体(联合体)COMBINE_STRUCT,8字体对齐,大小为16,所有int d超始为16,再者前方字段(COMBINE_STRUCT)为8字体对齐,所以大小为32.



1 0
原创粉丝点击