title: How to convert C++/CLI array to String or standard C array
body: <p>I have a managed array:</p>
  
  <pre><code>array&lt;unsigned char&gt;^ myGcArray;
  </code></pre>
  
  <p>Assume the array is null terminated. I want to display the contents using <code>Console::WriteLine()</code>. What's the easiest way to convert <code>myGcArray</code> to <code>String</code> ?</p>
  
  <p>One of the constructors to <code>String</code> has a parameter of <code>const char*</code>, so if I can convert <code>myGcArray</code> to that, then it would work too. How should I do that?</p>
  
  <p>I can copy the contents of <code>myGcArray</code> to a regular <code>unsigned char myarray[]</code>, but is that the best way?</p>
  
  <p>Thank you. </p>