C++ Library Reference

Declaring an fstream Without Specifying a File

You can declare an fstream without specifying a file and open the file later. For example, the following creates the ofstream toFile for writing.


ofstream toFile; 
toFile.open(argv[1], ios::out);