level 6
月无踪
楼主
位域:
当程序需要传递二进制数据给另一个程序或者硬件时可以使用位域。A bit-field must be an integral data type. It can be either signed or unsigned We indicate that a member is a bit-field by following the member name with a colon and a constant expression specifying the number of bits
storage compaction:if possible, packed within adjacent bits of the same integer. Whether and how the bits are packed into the integer is machine-dependent.Bit-fields with more than one bit are usually manipulated using the built-in bitwise
operators.The address-of operator (& ) cannot be applied to a bit-field, so there can be no pointersreferring to class bit-fields. Nor can a bit-field be a static member of its class.
2012年08月29日 13点08分
1
当程序需要传递二进制数据给另一个程序或者硬件时可以使用位域。A bit-field must be an integral data type. It can be either signed or unsigned We indicate that a member is a bit-field by following the member name with a colon and a constant expression specifying the number of bits
storage compaction:if possible, packed within adjacent bits of the same integer. Whether and how the bits are packed into the integer is machine-dependent.Bit-fields with more than one bit are usually manipulated using the built-in bitwise
operators.The address-of operator (& ) cannot be applied to a bit-field, so there can be no pointersreferring to class bit-fields. Nor can a bit-field be a static member of its class.