tags:

views:

37

answers:

1
+3  A: 

An ofstream represents a file on the file system:

int main()
{
    ofstream  file("Plop.txt");

    save_data(file);
}
Martin York
Steve314
It is very bad form. However, it's the OP's function.
DeadMG
ofstream provides a constructor and open() on top of ostream that initializes the underlying filestreambuf. You can still use ostream::rdbuf() to redirect it elsewhere, not only to a file. So, it does not necessarily represent a file.
Maxim Yegorushkin