So i've spent about 30minutes on this with no luck. Tried many ways of saving the file. It works when i save it into:
C:\Users\jsmit\OneDrive\Documents\Visual Studio 2017\Projects\Password Generator\Password Generator
but not when i try and save it into:
C:\Users\jsmit\OneDrive\Documents
or:
C:\Users\jsmit\Documents\New folder
This is my code for saving a file:
void savePassword(string stringpassword, string site) {
ofstream out("C:\Documents\New folder\output.txt", ofstream::app); // DOESN'T WORK
out << site << ": " << stringpassword << endl; // This is where it saves the password into the text file
out.close(); // Closes file
}
If i put:
ofstream out("Password.txt", ofstream::app); // ofstream:app stops overwrite
it works.
EDIT:::: Allows me to save to H:\New folder but not C: drive? How to fix?
How do i make it so it saves it into: C:\Users\jsmit\OneDrive\Documents