#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结构后面缺少;符号错误

相关文章:

  • 2021-11-27
  • 2022-12-23
  • 2022-12-23
  • 2021-06-19
  • 2022-01-06
  • 2021-07-22
猜你喜欢
  • 2022-12-23
  • 2021-12-08
  • 2022-01-12
  • 2022-12-23
  • 2022-02-17
  • 2021-04-03
  • 2022-12-23
相关资源
相似解决方案