padding mechanism in structures



Hello, All!

Could you please explain me how is the padding of 'structure' fields is
made?

For example:

struct {
char a1;
int a2;
double a3;
} str;

When I'm checking "sizeof str" in GCC compiler I get the value of size as
16, it means some bytes are padded right?

Thanks!

PS. Or, point me to Inet link, if there is one.

With best regards, Roman Mashak. E-mail: mrv@xxxxxxxx


.



Relevant Pages