ifstream in("C:\\file.test");
if(in.is_open())
cout<<"OPEN"<<endl;
can anyone thing of why this doesnt open a file, I wonder if something went wrong when reinstalling the OS




Posted 04 December 2009 - 10:41 AM
ifstream in("C:\\file.test");
if(in.is_open())
cout<<"OPEN"<<endl;
Posted 04 December 2009 - 11:04 AM
// ifstream::is_open
#include <iostream>
#include <fstream>
using namespace std;
int main () {
ifstream infile;
infile.open ("test.txt");
if (infile.is_open())
{
while (infile.good())
cout << (char) infile.get();
infile.close();
}
else
{
cout << "Error opening file";
}
return 0;
}
Posted 04 December 2009 - 11:26 AM
Posted 04 December 2009 - 11:42 AM
