title: Size of struct containing double field
body: <p>Firstly, I understand byte padding in structs. But I have still a small test contain a double field in struct and I don't know how to explain this :</p>
  
  <pre><code>typedef struct {
      char a;
      double b;
  }data;
  
  typedef struct{
      char a;
      int b;
  }single;
  
  int main(){
      printf("%d\n",sizeof(double));
      printf("%d\n",sizeof(single));
      printf("%d\n",sizeof(data));
  }
  </code></pre>
  
  <p>Through out this test, the answer is : <code>8</code> <code>8</code> and <code>16</code>.</p>
  
  <p>Why this result make me thinking ?</p>
  
  <p>By second test, we can see size of word on my machine is 4 bytes.</p>
  
  <p>By first test, we can see size of double is 8 bytes.</p>
  
  <p>So, at the struct <code>data</code> : the result should be 12 bytes : 4 bytes for char and 8 bytes for double.</p>
  
  <p>But, I don't know why the result is 16 bytes. (So strange with me)</p>
  
  <p>Please explain it for me, thanks :)</p>