title: C++/C# Data Marshalling not working as expected
body: <p>On the C++ side, I have this:</p>
  
  <pre><code>double* s;
      bool GetLeftOutputData(double ** a, int * i) 
      {
          s = new double[4]{ 25,24.0,33.0,57.0 };
          *a = s;
          *i = 4;
          return true;
      }
  </code></pre>
  
  <p>And on the C# side, I have:</p>
  
  <pre><code>[DllImport("MyDLL")]
  private static extern bool GetLeftOutputData(out IntPtr ptrResultVerts, out int resultVertLength);
  
   void TestLeftOutputData()
  {
      IntPtr ptrNativeData;
      int itemsLength;
  
      bool success = GetLeftOutputData(out ptrNativeData, out itemsLength);
      if (!success)
      {
      Debug.Log("Faild to get left out data");
      return;
      }
  
      double[] SArray = new double[itemsLength];  // Where the final data will be stored.
  
      Debug.Log("Length: " + itemsLength);
  
      IntPtr p = ptrNativeData;
      for (int i = 0; i &lt; itemsLength; i++)
      {
          Marshal.PtrToStructure(p, SArray[i]);
          p = new IntPtr(p.ToInt64() + Marshal.SizeOf(typeof(double)));
      }
  }
  </code></pre>
  
  <p>Code gives no error, but for some reason, double[] array is always filled with 0, i.e. no data is being copied. Where is my mistake?</p>