title: Structure memory alignment in C
body: <p>i have a query on following C programme </p>
  
  <p>code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main()
  {
      struct a
      {
          char arr[10];
          int i;
  
          float b;
      }v[2];
  
      printf("\n %d   %d  %d  \n",v[0].arr, &amp;v[0].i, &amp;v[0].b);
      printf("\n %d   %d  %d  \n",v[1].arr, &amp;v[1].i, &amp;v[1].b);
  
  
      printf("\nHello world!\n");
      return 0;
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code> 2686712   2686724  2686728
  
   2686732   2686744  2686748
  
   Hello world!
  </code></pre>
  
  <p>Question:
  v[0].arr == 2686712 and arr[10] that has size 10 bytes
  &amp;v[0].i &lt;&lt;&lt;&lt; this address should start immediately after the array ..
  since array is of 10 bytes .. the address of &amp;v[0].i should start from 2686712+10 i.e 2686722
  why is &amp;v[0].i == 2686724 and not 2686722</p>