assigning unsigned char* to string C++
<p>This is my sample code. Please let me know why it crashes over here.</p>

<pre><code>string MyFunction::GetString(unsigned char* inStrReference)
{
    unsigned char* bufPtr = inStrReference; 

    string newstring = (char*)bufPtr;

    return newstring;
}
</code></pre>
