Structure padding

Joined
Apr 13, 2010
Messages
1
Reaction score
0
Hi All...

In C structures compiler will be padding extra bytes. How it is detected by the compiler?

struct
{
char a;
int b;
}

Here 3 bytes are padded (in VC++) after char a..
How compiler has detected it..How does it know that it has to add 3 bytes??

Can anyone give me an example how compiler exactly detects it..

Thanks...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top