endl is a manipulator for output streams (like cout, or an instance of ofstream). it outputs the newline character - '\n' and then flushes the stream.