I am coding a mathematical simulation in c++, and each time I run the simulation, I want the output data (from an ofstream) to save in a unique location. I am using the __TIME__ and __DATE__ macros to generate the unique file names, in order to prevent overwriting previous data. I define the ofstream, like this for example:
of course it does not work. as you may know, the parameter of filepath for open is of string type, as a result you should write it like this: dataOut.open(filepath+".path")
Hope it will help.