M
Murasama
Hi there,
Im trying a simple file IO operation in Visual Studio .NET 2003 and it
can't seem to open the file.
If I run the exe in the debug directory it works fine but if I click
the start button (blue arrow) then it fails to open the file.
any ideas?
source:
#include <iostream>
#include <fstream>
using namespace std;
int main(){
ifstream in;
in.open("test.txt");
char str[80];
if(in.is_open()){
cout << "open ok" << endl;
in >> str;
cout << str;
cout << "printed?" << endl;
}
else
cout << "could not open file" << endl;
for(;
;
return 0;
}
Im trying a simple file IO operation in Visual Studio .NET 2003 and it
can't seem to open the file.
If I run the exe in the debug directory it works fine but if I click
the start button (blue arrow) then it fails to open the file.
any ideas?
source:
#include <iostream>
#include <fstream>
using namespace std;
int main(){
ifstream in;
in.open("test.txt");
char str[80];
if(in.is_open()){
cout << "open ok" << endl;
in >> str;
cout << str;
cout << "printed?" << endl;
}
else
cout << "could not open file" << endl;
for(;
return 0;
}