title: Passing user inputs as Arguments to a constructor
body: <p>I recently came across a problem where i cannot pass user fed values stored in variables as arguments to a constructor. My code looks like this:</p>
  
  <pre><code>class Complex_no{
  int real;
  int imaginary;
  Complex_no *ptr;
  float mag;
  public:
      Complex_no(int a, int b){
          real=a;
          imaginary=b;
      }
      Complex_no(){
          real=0;
          imaginary=0;
      }
  </code></pre>
  
  <p>Now in the main I have a code something like this:</p>
  
  <pre><code>Complex_no c;
  c.Complex_no (a,c);
  </code></pre>
  
  <p>where is a &amp; c are the variables used to store user input.The problem is that the compiler shows error stating that</p>
  
  <pre><code>invalid use of ‘Complex_no::Complex_no’ c.Complex_no(r,i);
  </code></pre>