I have a base class Fraction and a derived class iFraction. Fraction represents the improper fractions and iFraction represents the mixed fractions.
class Fraction {...};
class iFraction : public Fraction {...};
Now, I want to declare a friend function of these two class, namely convertF. The function convertF can convert the improper fractions(Fraction) to mixed fractions(iFraction). How cold I do this? Actually, I'd like to declare the function like this:
friend iFraction convertF (Fraction &Fra);
However, it can't be declared within the base calss Fraction. why?