title: Why doesn't reinterpret_cast convert 'unsigned char' to 'char'?
body: <p>I am trying to compile <a href="http://www.nongnu.org/libann/index.html" rel="nofollow">this</a> library using MSVC10, and this function is giving me headache:</p>
  
  <pre><code>/*! \brief Read bytes from a \c std::istream
      \param is The stream to be read.
      \param data A pointer to a location to store the bytes.
      \param size The number of bytes to be read.
  */
  void _read(std::istream &amp;is, unsigned char *data, int size)
  {
      for (int i=0; i &lt; size ; ++i )
        is.get(static_cast&lt;char&gt;(data[i]));
  }
  </code></pre>
  
  <blockquote>
    <p>error C2664: 'std::basic_istream&lt;_Elem,_Traits> &amp;std::basic_istream&lt;_Elem,_Traits>::get(_Elem &amp;)' : cannot convert parameter 1 from 'char' to 'char &amp;'</p>
  </blockquote>
  
  <p>The original used static_cast, so I try with reinterpret_cast as suggested elsewhere but that fails too:  </p>
  
  <blockquote>
    <p>error C2440: 'reinterpret_cast' : cannot convert from 'unsigned char' to 'char'</p>
  </blockquote>
  
  <p>This library comes with unix makefiles. What is the best way to resolve this compile error?</p>