我的 C++ 应用程序中有这个结构:
struct textField
{
//0
union nameField
{
void* ptr;
char cstring[16];
} text;
//16
uint8_t textLength;
//17
char unknown1[3];
//20
uint8_t fieldType;
//21
char unknown2[3];
//24
uint32_t unknown3;
//28
};
我知道在 VB6 中,它看起来像这样:
Private Type textField ' 0
cstring(0 To 15) As Byte ' 16
textLength As Byte ' 17
unknown1(0 To 2) As Byte ' 20
fieldType As Byte ' 21
unknown2(0 To 2) As Byte ' 24
unknown3 As Long ' 28
End Type
但是结构中的联合呢?如何实现?