摘要:
#include <stdio.h>#pragma pack(push,1)struct A{ unsigned char b; unsigned long a[3];};#pragma pack(push)int main(){ A m; m.a[0]=0xAABB; m.a[1]=0xCCDD; m.a[2]=0xEEFF; m.b='Z'; int sizes=sizeof(m); //把结构体转化成char* char* change=(char*)&m; // 把char* 转换成结构体 A* bb=(A*)(&(*change)); pr 阅读全文