I was working on some C code today and ran into something I wasn’t familiar with:
typedef struct {
uint8_t h:4;
uint8_t n:4;
} Buf;
What do those colons mean?
Bit Fields allow the packing of data in a structure. This is especially useful when memory or data storage is at a premium. Typical examples:
* Packing several objects […]










