C++ cast char * to unsigned char
<p>I am working in a c++ project where I have to use &lt; openssl/sha.h> and I am using in particular the SHA1 function. My problem is, that the function receives unsigned char[], and I need to get processed parameters passed as arguments to the program:</p>

<pre><code>int main(int argc, char* argv[])
{

  unsigned char message[] = argv[1];

  /* program continues using message */

}
</code></pre>

<p>And the error I am getting is the following:</p>

<pre><code>error: array initializer must be an initializer list or string literal
const unsigned char message[] = argv[1];
                    ^
</code></pre>

<p>So I am not getting to cast appropiately the argument input to the 'message' variable, to make the appropiate call to SHA1 function.</p>

<p>Thanks!!</p>