title: Marshaling two-dimensional array
body: <p>I want to marshal two-dimensional array  </p>
  
  <pre><code>int [10][20] //const dimensions size
  </code></pre>
  
  <p>from C++ dll to C# code. Is there automatic marshaler for that? Can't find good solution for such easy task. </p>
  
  <pre><code>    public int[,] _operators;
  </code></pre>
  
  <p>Gives undefined values.
  Yes, i can make it one dimensional only for marshaling and then read it again to 2 dimsions in C#, but is there automatic easy way?</p>
  
  <p>=================</p>
  
  <p>The best way i think is using of pointer like this:</p>
  
  <pre><code>            const int 1dSize = 10;
              const int 2dSize = 10;
              var ret = new int[1dSize, 2dSize];
  
          unsafe
          {
              int* ptrOnArray = NativeLibPrototypes.Get2DArrayPtr();
              for (int i1 = 0; i1 &lt; 1dSize; i1++)
              {
                  for (int i2 = 0; i2 &lt; 2dSize; i2++)
                  {
                      ret[i1, i2] = *ptrOnArray;
                      ptrOnArray++;
                  }
              }
           }
  </code></pre>