You declared operators outside the class as non-class functions
Fraction& operator ++ (Fraction); Fraction operator++(Fraction, int);
however then you try to define them as functions of a class member
Fraction& Fraction::operator ++ (Fraction){ // Increment prefix m_top += m_bottom; return *this; } Fraction Fraction::operator ++ (Fraction, int){ //Increment postfix }
Or declare them as member functions of a class as follows
class Fraction { public: Fraction & operator ++(); Fraction operator ++( int );
Again, the definition of the preincrement operator example may look like
Fraction & Fraction::operator ++(){
Or declare them as a function of nonclasses that are friends of the class, because they must have access to private members of the class data
class Fraction { public: friend Fraction & operator ++( Fraction & ); friend Fraction operator ++( Fraction &, int );
Again, the definition of the preincrement operator example may look like
Fraction & operator ++( Fraction &f ){
source share