Why would someone provide an empty default constructor for a class?
<pre><code>class complex
{
  float x,y;
public:
  complex(){}; //constructor with no arguments //what is use of giving such constructor
    complex(float z){x=y=z;}//constructor with 1 argument.
    complex(float real,float imag)
    {x=real;y=imag;}
    friend complex sum(complex,complex);
     friend void show(complex);
};
</code></pre>

<p>complex sum(complex c1,complex c2)
{
complex c3;
c3.x=c1.x+c2.x;
c3.y=c1.y+c2.y;
return (c3);
}</p>

<p>void show (complex c)
{
cout&lt;

<p>cout&lt;&lt;"p=";show(p);
cout&lt;&lt;"q=";show(q);
cout&lt;&lt;"r=";show(r);
return 0;
}</p>
