title: C++ fill dynamic array int
body: <p>I am writing program which will multiply matrix using threads. I have problem with filling dynamic int array <strong>(cannot use vector)</strong>.</p>
  
  <p>cpp file:</p>
  
  <pre><code>Matrix::Matrix(int n, int m)
  {
      mac_ = new int[n * m];
  }
  
  Matrix::Matrix(std::istream &amp; is)
  {
      int tmp;
      int i = 0;  
      is &gt;&gt; m_; //rows
      is &gt;&gt; n_; //columns
  
      Matrix(n_, m_); // using 1st constructor
  
      while (is.peek() != EOF) {
          is &gt;&gt; tmp;
          mac_[i] = tmp; // debug stop here
          i++;
      }
  }
  </code></pre>
  
  <p>part of hpp file:</p>
  
  <pre><code>private:
      int n_; // columns
      int m_; // rows
      int *mac_;
  </code></pre>
  
  <p>From debug I get:</p>
  
  <blockquote>
    <p>this  0x0079f7b0 {n_=3 m_=2 mac_=0x00000000 {???} }</p>
  </blockquote>
  
  <p>I know that i can write <code>mac_ = new int(n_*m_);</code> in 2nd constructor but I want to know why 1st does not work.</p>