Hello friends,
I have gone through various sites and understood what is structure padding, But no body tells it in the context of a microcontroller.
In my view, for example in a 32 bit machine following structure will be padded like this
struct
{
char a;
int b;
short int c;
char d;
} ;
[IMG][/IMG]
My question are
1)What happens if this structure is defined on 8 bit and 16 bit machines
2)How padding helps compiler for efficient programming even if it takes more space.
3)Finally why only structures are padded. Why not normal variables