C++: how do I convert an unsigned char to a string representing the binary value that the char has?
<pre><code>char myChar = 0x01;
</code></pre>

<p>how do I get my output to be "00000001"</p>

<p>If there is a way to do it with a built in function, without a loop (I can do this with a loop, I just want to be elegant), that would be preferred ?</p>

<p>As for the why I'm doing this: I'm saving these numbers in a file that an external library needs this formatting (weird, I know, but libraries have rules).</p>
