struct constructor + function parameter
<p><br>
I am a C++ beginner. I have the following code, the reult is not what I expect. The question is why, resp. what is wrong. For sure, the most of you see it at the first glance.</p>

<pre><code>struct Complex {
    float imag;
    float real;
    Complex( float i, float r) {
        imag = i;
        real = r;
    }
    Complex( float r) {
        Complex(0, r);
    }
    std::string str() {
        std::ostringstream s;
        s &lt;&lt; "imag: " &lt;&lt; imag &lt;&lt; " | real: " &lt;&lt; real &lt;&lt; std::endl;
        return s.str();
    }
};
class Complexes {
    std::vector&lt;Complex&gt; * _complexes;
public:
    Complexes(){
        _complexes = new std::vector&lt;Complex&gt;;
    }
    void Add( Complex elem ) {
        _complexes-&gt;push_back( elem ); 
    }
    std::string str( int index ) {
        std::ostringstream oss;
        Complex c = _complexes-&gt;at(index);
        oss &lt;&lt; c.str();
        return oss.str();
    }
};
int main(){
    Complexes * cs = new Complexes();
    //cs-&gt;Add(123.4f);
    cs-&gt;Add(Complex(123.4f));
    std::cout &lt;&lt; cs-&gt;str(0); return 0; }
</code></pre>

<p>for now I am interested in the basics of c++ not in the complexnumber theory ;-)
it would be nice if the "Add" function does also accept one real (without an extra overloading) instead of only a Complex-object is this possible?</p>

<p>many thanks in advance<br>
Oops</p>
