Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Structure padding

Thread Tools

Structure padding

123music 123music is offline
Junior Member
Join Date: Apr 2010
Posts: 1
Hi All...

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

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..

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Size of a structure : Structure Padding Kislay C Programming 15 07-13-2011 04:24 AM
structure padding Stephen Mayes C Programming 5 05-31-2005 03:49 AM
padding between variables in a structure C Programming 6 05-18-2005 08:06 AM
structure padding phoenix C Programming 1 03-11-2005 04:21 AM
Structure padding. Amarendra C Programming 13 06-22-2004 07:59 AM