1)
typedef union __rfun_gop_event_info
{
unsigned int evt;
struct
{
unsigned int reserved1:1;
unsigned int reserved0:1;
unsigned int f30:1;
unsigned int f29:1;
}frame;
}rfun_gop_event_info;
2)
typedef union __rfun_gop_event_info
{
unsigned int evt;
struct
{
unsigned int reserved1:1;
unsigned int reserved0:1;
unsigned int f30:1;
unsigned int f29:1;
}frame;
}rfun_gop_event_info;
谢谢。
答案 0 :(得分:3)
查看Delphi Corner上的这篇文章,解释变体记录,这正是您所需要的:
DelphiCorner: Variant Records: The equivalent to the C-union structure
摘录包含示例:
type
TPerson = record
FirstName, LastName: string[40];
BirthDate: TDate;
case Citizen: Boolean of
True: (BirthPlace: string[40]);
False: (Country: string[20];
EntryPort: string[20];
EntryDate: TDate;
ExitDate: TDate);
end;