You need to put << before the endl. It is a member of ofstream:
namespace std {
template >
class basic_ostream {
public:
basic_ostream& operator<<(
basic_ostream& (*pf)(basic_ostream&));
// ...
};
}
endl works like a "/n" to skip the line, so you need a cout line to skip