简体   繁体   中英

Translate from C to Delphi : struct fields align

Please help me, how I can do this in delphi? thanks.

struct x
{
uint32 a : 32;
unsigned int b : 20;
unsigned int c : 4;
};

that struct uses a C feature called bitfields where integers can have widths of fractional bytes. bitfields are not available in Delphi, see this answers to this question for details of how to do it using an object

How to simulate bit-fields in Delphi records?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM