title: Slack byte in C structures
body: <p>I know the concept of word boundary whereby computer stores structures using word boundary. I am working on a 64 bit CPU  with a 64 bit OS. The value of __WORDSIZE macro in limits.h is 64. So my word boundary is 8 bytes right?</p>
  
  <p>I have two structures:</p>
  
  <pre><code>struct a
  {
  int a;
  char b;
  float c;
  };
  </code></pre>
  
  <p>sizeof(struct a) gives 12 as answer. sizeof(int) is 4. sizeof(float) is 4.</p>
  
  <pre><code>For struct b{
  char a;
  char b;
  char c;
  char d;
  };
  </code></pre>
  
  <p>sizeof(struct b) is 4.</p>
  
  <p>These outputs suggest the word boundary is 4 bytes. How do I find the word boundary. Is it really equal to sizeof(int) then?</p>
  
  <p>Strangely:</p>
  
  <pre><code>struct c{
  char a;
  char b;
  char c;
  char d;
  char e;
  }
  </code></pre>
  
  <p>sizeof(struct c) is 5 bytes. Can anyone explain this please.</p>