[Dev-C++] file read / write issues in Win XP
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: davelaw <da...@fo...> - 2004-05-07 12:58:04
|
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...
|