#include <iostream>
#pragma pack(8)
using std::cout;
using std::endl;
struct example1
{
short a;
long b;
}

struct example2
{
char c;
example1 struct1;
short e;
}

#pragma pack()
int main()
{
example2 struct2;
cout
<<(unsigned int)(&struct2.struct1)-(unsigned int)(&struct2);
system(
"pause");
return 0;
}

struct结构后面缺少;符号错误

posted on 2010-05-29 22:16  c++我们一起学习  阅读(1161)  评论(0编辑  收藏  举报