Hello All,
I am using Cosmic C compiler for MC9S12DP256 (16 bit microcontroller) in my project.
I am facing the following problem
typedef struct {
unsigned char Var1[182]; // 182 bytes
unsigned long Var2; // 4 bytes
unsigned char Var3[16]; // 16 bytes
}ABC;
As you see here this structure should take 202 bytes of memory , but when i use sizeof(ABC) --> it returns 204
my doubt is, even though the elements in this structure is align to even position, why the compiler is padding 2 more bytes extra?
Thanks and regards - Rathinavel