title: How can I convert hexadecimal numbers to binary in C++?
body: <p>I am taking a beginning C++ class, and would like to convert letters between hex representations and binary. I can manage to print out the hex numbers using:</p>
  
  <pre><code>for(char c = 'a'; c &lt;= 'z'; c++){
      cout &lt;&lt; hex &lt;&lt; (int)c;
  }
  </code></pre>
  
  <p>But I can't do the same for binary. There is no <code>std::bin</code> that I can use to convert the decimal numbers to binary. </p>