operator overloading "+" for types complex/double
<p>I put only the useful information in Complex.cpp.</p>

<p>Here is my problem: I made the class complex which means it can calculate in complex.
In the <code>+</code> operator I want to enable complex + double, but I can only use complex + double in <code>main.cpp</code>. When I use a double variable + complex there is an error. Why is that? Can I fix it?</p>

<h3>Complex.h</h3>

<pre><code>#ifndef COMPLEX_H
#define COMPLEX_H
using namespace std;
class Complex
{
public:
    Complex( double = 0.0, double = 0.0 ); // constructor
    Complex operator+( const Complex &amp; ) const; // addition
    Complex operator-( const Complex &amp; ) const; // subtraction
    Complex operator*( const Complex &amp; ) const; // mul
    bool operator==( const Complex &amp; ) const;
    bool operator!=( const Complex &amp; ) const;
    friend ostream &amp;operator&lt;&lt;( ostream &amp; , const Complex&amp; ); 
    friend istream &amp;operator&gt;&gt;( istream &amp; , Complex&amp; );
    Complex operator+( const double &amp; ) const;
    //Complex &amp;operator+( const double &amp; ) const;
    void print() const; // output
private:
    double real; // real part
    double imaginary; // imaginary part
}; // end class Complex

#endif
</code></pre>

<h3>Complex.cpp</h3>

<pre><code>Complex Complex::operator+( const Complex &amp;operand2 ) const
{
    return Complex( real + operand2.real,imaginary + operand2.imaginary );
} // end function operator+

Complex Complex::operator+(const double &amp;operand2) const
{
    return Complex( real + operand2 , this-&gt;imaginary );
}
</code></pre>

<h3>main.cpp</h3>

<pre><code>int main()
{
Complex x;
Complex y( 4.3, 8.2 );
Complex z( 3.3, 1.1 );

    double ss = 5;
    x = z + ss;
    x = ss + z;//this syntax is illegal 
</code></pre>
