Re: [Dev-C++] Question about working directory in Win2k
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: A. K. <kli...@ad...> - 2004-06-22 13:40:08
|
David McKen wrote: > When I run the following program on win2k pro it has no problem finding > the input file because when I drag a file on to it windows gives it the > absolute filename. The problem is the executable & the input file are in > a folder on the E drive and the output file is written to c:\Documents > and Settings\david\ . Why do I have to specify the absolute filename > just to get the working directory to the one as the executable? I have Cause the program is run in C:\Dcuments... by windows by default. All console programs are. > an explorer window open to e:\primes and I drag the input file onto the > executable's icon. The program shows no errors, the output is just in > the wrong place. Any simple way to fix? Set the working directory in your program before you open files for writing. You could also set the working directory in the programs shortcut. Alex |