How do I initialize a 2-D dynamic memory array of pointers with all elements 0
<p>I want to initialize values of 2-D array to 0. But it seems not to work.
Can I initialize values of my **array in constructor to be 0. If yes the How.
My code is.</p>

<pre><code>#include &lt;iostream&gt;
using namespace std;

int main(){
int row, col;
cin&gt;&gt;row;
cin&gt;&gt;col;
int **array=new int*[row];
        for (int i=0; i&lt;row; i++){
            array[i]=new int[col];
        }
            for (int i=0; i&lt;row;i++){
                for (int j=0; j&lt;col; j++){
                    array[i][j]={'0'};
                    cout&lt;&lt;array[i][j]&lt;&lt;" ";
                }
                cout&lt;&lt;endl;
            }
</code></pre>

<p>}</p>

<p>Further can someone explain if I have to replace ith elem from the array with some other element, how would I deal with memory allocation.     </p>
