Conjugate function for complex number
<p>I am trying to create a function that conjugate a complex number
for example A(2, 3) will turn into A(2,-3) by typing ~A
i have done a little code below but i guess it's wrong, i hope you can help me slove this.
i have quoted the part that i did wrong in the code below.</p>

<pre><code>#include &lt;iostream&gt;
    using namespace std;
    class Complex
    {
    private:
        double real;
        double imaginenary;
    public:
        Complex();
        Complex(double r, double i = 0);

        // Declaration 
        Complex operator~(const Complex &amp; c) const;


        Complex operator+(const Complex &amp; c) const;
        Complex operator-(const Complex &amp; c) const;
        Complex operator*(const Complex &amp; c) const;
        Complex operator*(double n) const; 
       friend Complex operator*(double m, const Complex &amp; c)
               { return c * m; }    
        friend ostream &amp; operator&lt;&lt;(ostream &amp; os, const Complex &amp; c);
    };
    Complex::Complex()
    {
        real = imaginenary = 0;
    }

    Complex::Complex(double r, double i )
    {
        real = r;
        imaginenary = i;
    }



    // Definition
    Complex Complex::operator~(const Complex &amp; c) const   
    {
        Complex conj;
        conj.imaginenary = -1 * imaginenary;
        conj.real = real;
    }


    Complex Complex::operator+(const Complex &amp; c) const
    {
        Complex sum;
        sum.imaginenary = imaginenary + c.imaginenary;
        sum.real = real + c.real;
        return sum;
    }

    Complex Complex::operator-(const Complex &amp; c) const
    {
        Complex diff;
        diff.imaginenary = imaginenary - c.imaginenary;
        diff.real = real - c.real;
        return diff;
    }
    Complex Complex::operator*(const Complex &amp; c) const
    {
        Complex mult;
        mult.imaginenary = imaginenary * c.imaginenary;
        mult.real = real * c.real;
        return mult;
    }

    Complex Complex::operator*(double mult) const
    {
        Complex result;
        result.real = real * mult;
        result.imaginenary = imaginenary * mult;
        return result;
    }
    ostream &amp; operator&lt;&lt;(ostream &amp; os, const Complex &amp; c)
    {
        os &lt;&lt; "(" &lt;&lt; c.real &lt;&lt;"," &lt;&lt; c.imaginenary&lt;&lt;"i)";
        return os;
    }
    int main()
    {
        Complex A;
        Complex B(5, 40);
        Complex C(2, 55);
        cout &lt;&lt; "A, B, and C:\n";
        cout &lt;&lt; A &lt;&lt;"; " &lt;&lt; B &lt;&lt; ": " &lt;&lt; C &lt;&lt; endl;
        cout &lt;&lt; " complex conjugate is" &lt;&lt; ~C &lt;&lt; endl;  
        cout &lt;&lt; "B + C: " &lt;&lt; B+C &lt;&lt; endl;
        cout &lt;&lt; "B * C: " &lt;&lt; B*C &lt;&lt; endl;
        cout &lt;&lt; "10 * B: " &lt;&lt; 10*B &lt;&lt; endl;
        cout &lt;&lt; "B - C: " &lt;&lt; B - C &lt;&lt; endl;
        return 0;
    }
</code></pre>
