title: Operator Overloading Errors "no match for operator error"
body: <p>I am getting no match for 'operator +' error in main section.
  I overloaded all of the operators as friend except =
  I tried to debug but could not figured it out
  I don't know, what I am skipping.
  Please advise.</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  class fraction
  {
  long num;
  long den;
  public:
  fraction( ){num = 0L ; den = 1L ;}
  fraction(long l_num,long l_den){num = l_num ; den = l_den ;}
  fraction(const fraction&amp; f){num=f.num; den=f.den;}
  ~fraction ( ){}
  long getNum (void) const{return num ;}
  long getDen (void) const{return den ;}
  void  print(void)
  {
   if(den==0)den=1L;
   cout&lt;&lt;num&lt;&lt;"/"&lt;&lt;den &lt;&lt;endl;
  }
  fraction  inc ( )
  {
   long numX = (num) + (den);
   long denY = (den);
   return fraction(numX, denY );
  }
  friend fraction operator +(fraction &amp;f1 , fraction &amp;f2);
  friend fraction operator +(int i, fraction &amp;f2);
  friend fraction &amp;operator++(fraction &amp; f1);
  fraction operator =( const fraction &amp;f);
  friend fraction operator -(fraction &amp;f1 , fraction &amp;f2);
  friend fraction operator *(fraction &amp;f1 , fraction &amp;f2);
  friend fraction operator /(fraction &amp;f1 , fraction &amp;f2);
  };
  inline fraction operator +(fraction &amp;f1, fraction &amp;f2)
  {
  fraction temp;
  temp.num=(f1.num*f2.den)+(f1.den*f2.num);
  temp.den=f1.den*f2.den;
  return temp;
  }
  inline fraction operator +(int i, fraction &amp;f2)
  {
  fraction temp;
  temp.num=i*f2.den+f2.num;
  temp.den=f2.den;
  return temp;
  }
  inline fraction &amp;operator++(fraction&amp; f1)
  {
  f1.num=f1.num+f1.den;
  return f1;
  }
  inline fraction fraction::operator=(const fraction &amp;f)
  {
  num=f.num;
  den=f.den;
  return*this;
  }
  inline fraction operator -(fraction &amp;f1, fraction &amp;f2)
  {
  fraction temp;
  temp.num=(f1.num*f2.den)-(f1.den*f2.num);
  temp.den=f1.den*f2.den;
  return temp;
  }
  inline fraction operator *(fraction &amp;f1, fraction &amp;f2)
  {
  fraction temp;
  temp.num=f1.num*f2.num;
  temp.den=f1.den*f2.den;
  return temp;
  }
  inline fraction operator /(fraction &amp;f1 , fraction &amp;f2)
  {
  fraction temp;
  temp.num=f1.num*f2.den;
  temp.den=f1.den*f2.num;
  return temp;
  }
  int main ( )
  {
  fraction f1, f2(2L,0L);
  fraction f3(f2);
  f1.print();
  f2.print();
  f3.print();
  f3 = f3 + fraction (-5 , 4);
  f1 = f2 + f3;
  f1.print ( );
  f1 = f2 - f3;
  f1.print();
  f1 = f2 * f3;
  f1.print();
  (++ (++f1)).print();
  f1 = f2 / f3;
  f1.print();
  f1 = 5 + f1;
  f1.print();
  return 0;
  }
  </code></pre>