title: Dynamic 2D Array Initialization
body: <p>I want to create  and initialize a 2D array but the initialization is failed. I encounter "The program has unexpectedly finished." in Qt Creator.</p>
  
  <p>What is wrong?</p>
  
  <p><strong>in .h file</strong></p>
  
  <pre><code>private:
      int pop;
      int d;
      float **uye;
  </code></pre>
  
  <p><strong>in .cpp file</strong></p>
  
  <pre><code>pop=50;
  d=12;
  uye = new float*[pop];
  for(int i=0; i&lt;d; i++) uye[i] = new float[d];
  
  for(int n=0; n&lt;pop; n++)
  {
      for(int m=0; m&lt;d; m++)
      {
          uye[n][m] = (float) n*m;
      }
  }
  </code></pre>