Hey all. I've been teaching myself a little C++ and for whatever reason I was doing it on my Windows PC mostly. Well, that blew up (not joking ) yesterday so I'm moving to my lovely reliable Mac.
Just one question. In C++ when I want to output a file using this:
ofstream newFile("records.txt", ios::app);
How do I make it so the file is created in the same directory and the unix executable? I tired:
ofstream newFile("./records.txt", ios::app);
. = current directory in Unix? but that didn't work... it keeps creating them in the root directory for the user instead. On Windows it automatically defaulted to creating the file in the same directory.
Suggestions welcome! Thanks!
Just one question. In C++ when I want to output a file using this:
ofstream newFile("records.txt", ios::app);
How do I make it so the file is created in the same directory and the unix executable? I tired:
ofstream newFile("./records.txt", ios::app);
. = current directory in Unix? but that didn't work... it keeps creating them in the root directory for the user instead. On Windows it automatically defaulted to creating the file in the same directory.
Suggestions welcome! Thanks!