You need to fully define the name ostream with the namespace name in which this class lives:
std::ostream
So, your statement of the operator should become:
friend std::ostream& operator << (std::ostream &os, const Number &f);
Alternatively, you can have a using declaration before the unqualified name ostream :
using std::ostream;
This will allow you to write the name ostream without full qualifications, as in the current version of the program.
source share