Two dimensional array allocation
<p>i have following code for allocation two dimensional array</p>

<pre><code>#include &lt;iostream&gt;
using namespace std;
int **malloc2d(int r,int c){
    int **t=new int*[r];
     for (int i=0;i&lt;r;i++)
         t[i]=new int[c];

      for (int i=0;i&lt;r;i++){
           for (int j=0;j&lt;c;j++){
                t[i][j]=i+j;
           }
      }
     return t;
     }

int main(){
    int m=10;
    int n=10;
    int **a=malloc2d(m,n);
     for (int i=0;i&lt;m;i++){
          for (int j=0;j&lt;n;j++){

              cout&lt;&lt;a[i][j]&lt;&lt; " ";
              cout&lt;&lt; " \n";
          }
          cout&lt;&lt; " \n";
     }


    return 0;


}
</code></pre>

<p>it works but my question is: how good    is  this code according to performance efficienty or  according to   code speed? thanks</p>
