title: How to marshal an unknown length C++ string to C# using its pointer?
body: <p>I'm trying to marshal a dynamically allocated char array in a struct to C#. The struct has a pointer to the array. The problem is the char array contains multiple null terminated strings and the last string is terminated by two consecutive null chars.</p>
  
  <p>If I try to marshal it as <code>LPStr</code> I will get only de first string in the "list".</p>
  
  <p>I tried using UnmanagedMemoryStream but it requires to know the length of the array.</p>
  
  <p>Is there a way to read the bytes as a stream without knowing the length of the array? (Aside from using a n length byte buffer and keep increasing the pointer until two consecutive null terminating chars are found).</p>