Difference dynamic static 2d array c++
<p>Im using opensource library called wxFreeChart to draw some XY charts. In example there is code which uses static array as a serie :</p>

<pre><code>double data1[][2] = {
                { 10, 20, },
                { 13, 16, },
                { 7, 30, },
                { 15, 34, },
                { 25, 4, },
        };

dataset-&gt;AddSerie((double *) data1, WXSIZEOF(dynamicArray));
</code></pre>

<p>WXSIZEOF ismacro defined like: sizeof(array)/sizeof(array[0])       </p>

<p>In this case everything works great but in my program Im using dynamic arrays (according to users input).</p>

<p>I made a test and wrotecode like below:</p>

<pre><code>double **dynamicArray = NULL;
        dynamicArray = new double *[5] ;

        for( int i = 0 ; i &lt; 5 ; i++ )
            dynamicArray[i] = new double[2];

        dynamicArray [0][0] = 10;
        dynamicArray [0][1] = 20;
        dynamicArray [1][0] = 13;
        dynamicArray [1][1] = 16;
        dynamicArray [2][0] = 7;
        dynamicArray [2][1] = 30;
        dynamicArray [3][0] = 15;
        dynamicArray [3][1] = 34;
        dynamicArray [4][0] = 25;
        dynamicArray [4][1] = 4;

dataset-&gt;AddSerie((double *) *dynamicArray, WXSIZEOF(dynamicArray));
</code></pre>

<p>But it doesnt work correctly. I mean point arent drawn. I wonder if there is any possibility that I can "cheat" that method and give it dynamic array in way it understands it and will read data from correct place</p>

<p>thanks for help     </p>
