title: Process exited with return value 3221226356
body: <p>I started to write simple class for matrix manipulation, one constructor fills a matrix with one number and other one takes 2d array as its argument.</p>
  
  <pre><code>    #include &lt;iostream&gt;
  
  using namespace std;
  int i,j;
  class Matrica
  {
  public:
      Matrica(int, int, double);
      Matrica(int, int, double*);
      ~Matrica();
      void saberi(Matrica, Matrica);
      void read();
      void print();
  private:
      int n,m;
      double* matrix;  
  };
  
  Matrica::Matrica(int a, int b, double broj)
  {
      n = a;
      m = b;
      matrix = new double[n*m];
      for(i=0;i&lt;n;i++) {
          for(j=0;j&lt;m;j++) {
              matrix[i*n + j] = broj;
          }
      }
  }
  
  Matrica::Matrica(int a, int b, double* matr)
  {
      n = a;
      m = b;
      matrix = new double[n*m];
      for(i=0;i&lt;n;i++) {
          for(j=0;j&lt;m;j++) {
              matrix[i*n + j] = matr[i*n +j];
          }
      }
  
  }
  Matrica::~Matrica() {
      delete[] matrix;
  }
  
  void Matrica::read() {
      double e;
      for(i=0;i&lt;n;i++) {
          for(j=0;j&lt;m;j++) {
              cout&lt;&lt; "insert element ["&lt;&lt;i&lt;&lt;"]["&lt;&lt;j&lt;&lt;"] :" &lt;&lt;endl;
              cin &gt;&gt; e;
              matrix[n*i +j] = e;
              cout&lt;&lt; endl;
          }
      }
  }
  
  void Matrica::print() {
      for(i=0;i&lt;n;i++) {
          for(j=0;j&lt;m;j++) {
              cout &lt;&lt; matrix[n*i + j] &lt;&lt; " ";
          }
          cout &lt;&lt; endl;
      }
  }
  void Matrica::saberi(Matrica A, Matrica B) {
      cout &lt;&lt; "foo";
  }
  
  int main()
  {
  
      Matrica A(3,3,1);
      double K[3][3] = {{1,2,3},{4,5,6},{7,8,9}};
      Matrica B(3,3,&amp;K[0][0]);
      Matrica C(3,3,7);
      C.saberi(A,B);
      return 0;
  }
  </code></pre>
  
  <p>My program worked ok before I added empty "saberi" method which takes two objects as arguments. If I call it, my program crashes with 3221226356 return value. What could be wrong? Thanks in advance.</p>