Suppose I declared a file ofstream myFile. Now I only want to create this file once, and when I execute this line a second time I don’t want to overwrite the file and create a new one?
Suppose I declared a file ofstream myFile . Now I only want to create
Share
If you have a one-file one-function setup (such as a log) you may consider using a static variable.
For example:
Just too be cool from main function you should push a clean up function