title: Convert C++ byte array to a C string
body: <p>I'm trying to convert a byte array to a string in C but I can't quite figure it out.</p>
  
  <p>I have an example of what works for me in C++ but I need to convert it to C.</p>
  
  <p>The C++ code is below:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  
  typedef unsigned char BYTE;
  
  int main(int argc, char *argv[])
  {
    BYTE byteArray[5] = { 0x48, 0x65, 0x6C, 0x6C, 0x6F };
    std::string s(reinterpret_cast&lt;char*&gt;(byteArray), sizeof(byteArray));
    std::cout &lt;&lt; s &lt;&lt; std::endl;
  
    return EXIT_SUCCESS;
  }
  </code></pre>
  
  <p>Can anyone point me in the right direction?</p>