I am trying to understand why I am getting wrong sizeof for the below structure. My desired answer should be 12 but I am getting 16. Can you please explain what I am doing wrong?
struct dns_answer_section
{
uint16_t name;
uint16_t type;
uint16_t class;
uint32_t ttl;
uint16_t data_len;
};