title: What's the difference between assignment operator and copy constructor?
body: <p>I don't understand the difference between assignment constructor and copy constructor in C++. It is like this:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>class A {
  public:
      A() {
          cout &lt;&lt; "A::A()" &lt;&lt; endl;
      }
  };
  
  // The copy constructor
  A a = b;
  
  // The assignment constructor
  A c;
  c = a;
  
  // Is it right?
  </code></pre>
  
  <p>I want to know how to allocate memory of the assignment constructor and copy constructor?</p>