Re: [Dev-C++] file read / write issues in Win XP
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Per W. <pw...@ia...> - 2004-05-07 13:12:25
|
Whenever you have these kind of problems, you might use getcwd() to find
out for yourself which directory your program tries to open the files
from.
/Per W
On Fri, 7 May 2004, davelaw wrote:
> I am a C++ newbie - and new to Dev-C++. I'm running through Bruce Eckel's
> TICPP2v1 exercises using a Win XP Home machine and Dev-C++ v4.9.8.7. I've set
> up a the Path to my default working directory, and I can run my compiled
> programs from the console without using the absolute path. But my programs
> won't read or write a file in my default directory, unless I use the entire
> path. For example, I create a filetest.exe as follows, and the error msg
> appears each time. But substituting the entire pathname fixes the problem.
>
> #include <iostream>
> #include <fstream>
> #include <string>
> using namespace std;
>
> int main() {
> ifstream in("filetest.cpp");
> if (! in.is_open()) {
> cout << "Error opening file"; exit(1); }
> string s;
> s = " opened successfully";
> cout << in << s;
> return 0;
> }
>
> Did I miss a crucial setup setting in Dev-C++? Or is this a Win XP issue?
>
> Thanks
> Dave
>
> ----------------
> David Lawrence
> da...@fo...
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by Sleepycat Software
> Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to
> deliver higher performing products faster, at low TCO.
> http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|