C++: how do I convert hex char to unsigned char?
<p>I have a method that takes unsigned chars, but I want to pass it 0x01.</p>

<p>I know I can represent hex chars in strings by going "\x01"...
but that is still a signed char.</p>

<p>EDIT:
some code: </p>

<pre><code>kennys_hash((unsigned char const *)"\x00"); // the method call
</code></pre>

<p>the error:</p>

<pre><code>src/main.cpp:88: error: invalid conversion from ‘const unsigned char*’ to ‘unsigned char’
src/main.cpp:88: error:   initializing argument 1 of ‘unsigned char kennys_hash(unsigned char)’
</code></pre>

<p>the method header: </p>

<pre><code>unsigned char kennys_hash(unsigned char out)
</code></pre>

<p>ALso, when the cast is just to unsigned char, I get this error: </p>

<pre><code>src/main.cpp:88: error: cast from ‘const char*’ to ‘unsigned char’ loses precision
</code></pre>
