title: Size of a struct with float and uint8_t in C
body: <p>let say I have a program like this,</p>
  
  <pre class="lang-c prettyprint-override"><code>typedef struct
  {
      float hello;
  } tData;
  
  int main()
  {
      printf("%d", sizeof(tData));
  }
  </code></pre>
  
  <p>The value is 4, as the float is 4 bytes. It showed as expected.</p>
  
  <p>However, when I add a new variable,</p>
  
  <pre class="lang-c prettyprint-override"><code>typedef struct
  {
      uint8_t bool1:1;
      float hello;
  } tData;
  
  int main()
  {
      printf("%d", sizeof(tData));
  }
  </code></pre>
  
  <p>I thought that it should display 5, but I got 8. May I know why?</p>