title: How to convert unsigned char to binary representation
body: <p>I'm trying to convert unsigned chars to their hex ASCII values but in binary form.</p>
  
  <p>For example:</p>
  
  <p>unsigned char C
  to
  0100 0011 (43)</p>
  
  <p>I can get from hex to binary the issue is getting from char to its hex value.</p>
  
  <pre><code>for (n = 0; n &lt; 8; n++){
      binary[n] = (letter &gt;&gt; n) &amp; 1;}
  </code></pre>
  
  <p>I keep getting the wrong values because the letter is going in as its own ASCII value rather than the binary version of the hex ASCII value</p>