title: How to resolve a "cppcoreguidelines-pro-type-cstyle-cast" error in C++?
body: <p>I'm working on C++ with Visual Studio 2015 64-bit and Clang as my compiler.</p>
  
  <p>I tried to convert a <code>string</code> to <code>unsigned char*</code> with the code below:</p>
  
  <pre><code>string content = "some content from file";
  unsigned char* m_Test = (unsigned char*)content.c_str();
  </code></pre>
  
  <p>However, this resulted in an error when I tried to build the project:</p>
  
  <blockquote>
    <p>error: do not use C-style cast to convert between unrelated types
    [cppcoreguidelines-pro-type-cstyle-cast,-warnings-as-errors]</p>
  </blockquote>
  
  <p>Any idea how I can work around it? Really appreciate it if you can shed some light.</p>