Stack overflow when overloading << operator
<pre><code>#include&lt;iostream&gt;
using namespace std;

class aClass
{
public:
    char *message;

    aClass(const char *message);
    ~aClass(){delete[] message;}
};

aClass::aClass(const char* newmessage)
{
    message = new char[strlen(newmessage) +1];
    strcpy(message,newmessage);
}

const ostream&amp; operator&lt;&lt;(const ostream&amp; o, const aClass &amp;a)
{
    o &lt;&lt; a.message;
    return o;
}

int main()
{
    aClass b("Hello");
    cout &lt;&lt; b;
}
</code></pre>

<p>Can someone explain to me why the code above produces an infinite loop?</p>
