1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Where to save .dat file for C++ programming

  1. Apr 9, 2012 #1
    1. The problem statement, all variables and given/known data
    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");
     
  2. jcsd
  3. Apr 9, 2012 #2
    If you open a file that does not exist, it will be made.
     
  4. Apr 9, 2012 #3
    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.
     
  5. Apr 9, 2012 #4
    The default place for saving the file (and accessing files) is in the same directory in which the program is executing.
     
  6. Apr 9, 2012 #5
    Thank you!
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Where to save .dat file for C++ programming
  1. C++ Program (Replies: 17)

Loading...