Where to save .dat file for C++ programming

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
4 replies · 3K views
mathnoobie
Messages
62
Reaction score
0

Homework Statement


I'm starting my C++ project which requires me to call a file stream and output the data to four other output streams.
Before I start, I want to know if I need to have a .dat file premade and saved somewhere so I can call it or do I just make that file in my code by using ifstream in_stream.open("name.dat");
 
Physics news on Phys.org
If you open a file that does not exist, it will be made.
 
Yes. But I am required to turn in an input file and many output files, I wouldn't even know where those would be saved if I don't know where to save my input file.
 
The default place for saving the file (and accessing files) is in the same directory in which the program is executing.