Converting pointer to 2D array
<p>I'm calling C++ method from C# code and passing the pointer of first element of a 2D array, and the dimensions of the array to the C++ function:</p>

<p><strong>C# code</strong></p>

<pre><code>fixed (bool* addressOfMonochromeBoolMatrixOfBitmap = &amp;monochromeBoolMatrixOfBitmap[0, 0]
{             
    NativeGetUniquenessMatrixOfBitmap(addressOfMonochromeBoolMatrixOfBitmap, Width, Height);         
}
</code></pre>

<p><strong>C++ code</strong></p>

<pre><code>extern "C" __declspec(dllexport) void NativeGetUniquenessMatrixOfBitmap ( bool* addressOfMonochromeBoolMatrixOfBitmap, 
    int boolMatrixWidth, int boolMatrixHeight)
{
}
</code></pre>

<p>In the C++ code I want to cast the bool* pointer to 2D array, in order to access the elements using conventional array syntax: someArray[1][4]. 
I've tried this code:</p>

<pre><code>bool (*boolMatrix)[boolMatrixWidth][boolMatrixHeight] = (bool (*)[boolMatrixWidth][boolMatrixHeight])addressOfMonochromeBoolMatrixOfBitmap;
</code></pre>

<p>But it doesn't compile giving the message "expected constant expression". </p>

<p>Please share any ideas. Thanks.</p>
