
please wait
ofstream write("file.txt");
the file is saved in the same location of the programofstream write("C:\\Users\\Bazzy\\Documents\\file.txt");
the file is saved in the given directoryEither create a single file like "~/.myapprc" or make a subdirectory like "~/.myapp" with files inside it. |
The same thing, except you cannot use "~/" to represent the user's home directory. (And you don't need to prefix the filename with a period to hide it.) You must get the directory name from the Registry: - Key "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" - Value "AppData" (type: REG_EXPAND_SZ) It is an expandable value, remember. Use the ExpandEnvironmentStrings() function on it before you use it. |