Sun Studio 12 Update 1: C++ User's Guide

14.4.1.2 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);