title: bit masking (char)(0xFFFFFFB8 & 0xFF) doesn't work in c
body: <p>I am struggling with bit masking or maybe handling bit overflow.</p>
  
  <p>I get data from data stream, and it is stored in <code>char</code> type buffer, and I need to access particular index of the buffer. When I try so, I get unexpected results.</p>
  
  <p>Something like below..</p>
  
  <pre><code>char buffer[BUFFER_SIZE];
  
  /* ...recv from network stream performed... */
  
  printf("buffer[index] = 0x%x\n", buffer[index]); /* =&gt; 0xFFFFFFB8 */
  
  char dummyChar = buffer[index] &amp; 0x000000FF;
  printf("dummyChar = 0x%x\n", dummyChar); /* =&gt; 0xFFFFFFB8 */
  </code></pre>
  
  <p>The buffer is <code>char</code> type. Why am I getting 32 bits size when I print buffer[index]?</p>
  
  <p>I also  masked the <code>buffer[index]</code> with 0x000000FF, but I am still getting 0xFFFFFFB8. Why?</p>
  
  <p>I only want to get 0xB8, can anyone tell me how? I am pretty sure it is 1 byte size..</p>