title: Representing individual bits in C
body: <p>If I have 16 bits that represent 3 pairs of values, each 5 bits long, and one other 1 bit value, in exactly this order, is it safe to use a bitfield to describe this? Does ANSI <strong>C</strong> guarantee that the bits will be exactly in the order that I specify?</p>
  
  <pre><code>struct {
      unsigned v1 : 5;
      unsigned v2 : 5;
      unsigned v3 : 5;
      unsigned v4 : 1;
  } test;
  </code></pre>
  
  <p>If not, is there any other data structure that I can use to represent this? Or should I just store two 8 bit <code>char</code>s and manipulate them programmatically to be assured of portability?</p>