如C中的这种结构怎么定义?
typedef struct aaa{
unsigned short aa:4;
unsigned short bb:4;
};

解决方案 »

  1.   

    aaa = record
      aa: byte;
      bb: byte;
    end;
      

  2.   

    做成类:
    private
      Faabb:byte;
    property aa:byte read GetAA write SetAA;
    property bb:byte read GetBB write SetBB;使用起来,就方便了
      

  3.   

    有个TBits类,不过功能太少
    Use TBits to store and access an indefinite number of boolean values. TBits can store as many of boolean values as can fit in available memory, automatically expanding its storage space as needed. If the number of boolean values is limited to 32, the same functionality can be achieved using a 32-bit integer with the bitwise AND (Delphi) or & (C++) and OR (Delphi) or | (C++) operators.