title: What is the default operation of the '=' operator?
body: <p>I have a class, <code>Number</code>, which represents a double with two digits after the dot. Before I overloaded the <code>=</code> operator I ran some tests and got a little confused:</p>
  
  <pre><code>int main(int argc, char **argv) {
      Number *w = new Number(1.111);
      Number *q = new Number(3.444);
      *w = *q;
      std::cout &lt;&lt; w-&gt;GetNumber() &lt;&lt;std::endl;
      delete q;
      std::cout &lt;&lt; w-&gt;GetNumber() &lt;&lt;std::endl;
  
      Number e(5.555);
      Number t = e;
      std::cout &lt;&lt;t.GetNumber() &lt;&lt;std::endl;
  }
  </code></pre>
  
  <p>The output was</p>
  
  <pre><code>3.44
  3.44
  5.55
  </code></pre>
  
  <p>What is the default action of '=' on user defined objects when '=' is not overloaded?</p>
  
  <p>I was under the impression that when writing:</p>
  
  <pre><code>*w = *q;
  </code></pre>
  
  <p><code>w</code> points to <code>q</code> (like in Java). However, in my example I deleted <code>q</code> and <code>w</code> still had the correct values.</p>
  
  <p>Anyway, I got same results when I made assignments <em>without</em> overloading <code>=</code> and <em>with</em> overloading <code>=</code>.</p>