Offsets of structure members at the compile time or using IDE

1.2k Views Asked by At

How can I know how all members of the structure are located inside? I need detailed listing with all the offsets and sizes Is there's any plugin for IDE, I use Visual Studio 2013? I can't use offset of or something similar because I need information about all the fields

struct Test {
  int   a; //0x0000 (4)
  float b; //0x0004 (4)
  bool  c; //0x0008 (1)
}; //Size=0x000C

Thank you

1

There are 1 best solutions below

0
On

There is no built-in reflection regarding structs. There are libraries which introduce more code (usually a macro), which make the struct reflectable.

Examples:

If you can change your auto-generated code to include some of this, you might have some luck. Otherwise, I don't think there is a way.