Locally disable padding

前端 未结 2 1623
傲寒
傲寒 2020-12-09 17:18

I write a parser for some data structure, after hours of debugging I found out that the problem is Visual Studio doesn\'t interpret the structures as I tell it. It seems som

2条回答
  •  时光说笑
    2020-12-09 17:45

    Use the #pragma pack directive for that:

    #pragma pack(push, 1)
    struct foo { 
      // etc..
    };
    #pragma pack(pop)
    

提交回复
热议问题