Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

regarding output files

Status
Not open for further replies.

Neoyanderson

Programmer
Apr 18, 2004
16
US
about output files... what is the default location where the file is created? is there any way to specify an exact location?
 
The current directory is the default location if no path in the file name.
Specify full path in the open function (or file constructor):
Code:
FILE* fnew = fopen("D:\\mydir\\mysubdir\\newfile.txt","w+");
// or
ofstream fnew("D:\\mydir\\mysubdir\\newfile.txt");
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top