title: Static Object in C++
body: <p>I have <code>Mtx</code> that does some calculations between matrices</p>
  
  <pre><code>Mtx M1(rows1,cols1,1); //instantiate data members and fill the matrix with 1s
  Mtx M2(rows2,cols2,2); //instantiate data members and fill the matrix with 2s
  
  Mtx M3(rows3,cols3,0); //instantiate data members and fill the matrix with 0s
  
  
  M3 += M1; //+= is overloaded - First M3
  M3 -= M2; //-= is overloaded - Second M3
  </code></pre>
  
  <p>The first <code>M3</code> takes <code>M3</code> that filled with zeros and adds it to <code>M1</code> and the answer will be assign to <code>M3</code>. I have no problem here.</p>
  
  <p>The problem is with the second <code>M3</code>! It doesn't subtract <code>M3</code> that filled with zeros, rather It  uses the result from the previous operation and subtracts it from <code>M2</code>.</p>
  
  <p>How can I make <code>M3</code> static that keeps its values? Is it something related to static object?
  I hope you got my point!</p>
  
  <p>Your help is appreciated...     </p>