Understanding Memory Alignment of C Structs in Embedded Systems

Understanding Memory Alignment of C Structs in Embedded Systems

Today, I bring you a classic and commonly mistaken question about memory alignment of C language structures: Calculate the number of bytes occupied by the following structure in a 32-bit environment: typedef struct test_struct { char a; short b; char c; int d; char e; }test_struct; Please provide your answer: Let’s take a look at … Read more

×