When is it worthwhile to use bit fields?
问题 Is it worthwhile using C's bit-field implementation? If so, when is it ever used? I was looking through some emulator code and it looks like the registers for the chips are not being implemented using bit fields. Is this something that is avoided for performance reasons (or some other reason)? Are there still times when bit-fields are used? (ie firmware to put on actual chips, etc) 回答1: Bit-fields are typically only used when there's a need to map structure fields to specific bit slices,