How to initialize a dynamic 2D array using memset?
<p>What's wrong with this little program? I cannot get the correct answer. I just use m[1][1] to test but it's always 0! </p>

<pre><code>#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;string.h&gt;
int main()
{
    int **m;
    m = new int*[5];
    for( int i = 0 ; i &lt; 5; i++ )
    {
        m[i] = new int[5];
        memset(m[i],1,sizeof(int)*5);   
    }

    printf("%f",*(*(m+1)+1));
    return 0;

}
</code></pre>
