title: Split uint8 into 4 unit2 in C to have unit10 later
body: <p>I want to make an extension to my uint8 variable with 2 other bits to have let say uint10. For that I used this method, but it takes only the mask in the consideration.</p>
  
  <pre><code>void splitbits(unsigned int x){ //x=11001010 and i want to have this for any given X
     split[0]=(x&gt;&gt; 6) &amp; 0x01 ; //split[0]=11
     split[1]=(x&gt;&gt; 4) &amp; 0x01 ; //split[1]=00
     split[2]=(x&gt;&gt; 2) &amp; 0x01 ; //split[2]=10
     split[3]=x &amp; 0x01 ; //split[3]=10
  }
  </code></pre>