82. Structures-i

Question.3

A developer packs a struct to match a UART protocol frame exactly:

typedef struct __attribute__((packed)) {
   uint8_t  cmd;
   uint32_t data;
   uint8_t  crc;
} Frame;

sizeof(Frame) is now 6 bytes — exactly matching the wire format. Is this safe to use on an ARM Cortex-M?

Need Help? Refer to the Quick Guide below

Select Answer

Restart quiz!