struct strOne{
char c[2];
int int1;
float f2;
}
char b[sizeof(strOne)];
怎么把它们互相转换?也就是说让struct变成char流存起来和 反过来调用出来struct?
struct strOne c;
memcpy(b, &c, sizeof(struct strOne));
memcpy(&c, b, sizeof(b));
or
char *p = (char *)&c;
struct strOne *pp = (struct strOne *)b;