C++ Constructor call
<p>I have written this small code snippet in C++, the output is also attached.
I fail to understand why the constructor is being called only once, while i can see two calls being made for destructor.</p>

<p>From what i understand, default constructor and overloaded assignment operator should be called at line 28.</p>

<p>Can someone please throw some light on this:</p>

<pre><code>  1 #include &lt;iostream&gt;
  2 using namespace std;
  3 
  4 class ABC {
  5   char c;
  6   public:
  7     ABC() {
  8       cout &lt;&lt; "default" &lt;&lt; endl;
  9     }
 10     ABC(char c) {
 11       this-&gt;c = c;
 12       cout &lt;&lt; c &lt;&lt; endl;
 13     }
 14     ~ABC() {
 15       cout &lt;&lt; hex &lt;&lt; this &lt;&lt; " destructor " &lt;&lt; c &lt;&lt; endl;
 16     }
 17     void method() {
 18       cout &lt;&lt; "method" &lt;&lt; endl;
 19     }
 20     void operator= (const ABC&amp; a) {
 21       cout &lt;&lt; "operator" &lt;&lt; endl;
 22     }
 23
 24 };
 25 
 26 int main() {
 27   ABC b('b');
 28   ABC a = b;
 29 }
</code></pre>

<p><hr /></p>

<pre><code>Output in g++ version 4.0.1:
~/src$ g++ test.cpp
~/src$ ./a.out 
b
0xbffff0ee destructor b
0xbffff0ef destructor b
</code></pre>
