output nug sack

....
Last edited on
Hi there! You can certainly open the file in printStart();
no issues with scope here, just make sure to actually put some code to open the file.

However because you close the file in your destructor, depending on your logic it may be wise to open the file in your constructor, you already specify the filename in the constructor- so it would be logical.

The scope of that file stream is the life of your object, I don't see any issues at all with the code you've presented besides the missing open call to your file.
Topic archived. No new replies allowed.