C
chiku
Hi,
When i tried below code it seems i am getting error in open method but
same program when i tried with ofstream object insted of fstream i got
success . Their was NO already existing file with passed name . Any
idea why?
Chiku
#include<iostream>
#include<fstream>
using namespace std;
int main(void)
{
fstream mystream;
mystream.open("testdirect.txt");
if(mystream.is_open())
{
cout << "file open success"<<"\n";
}
else
{
cout << "failed"<<"\n";
}
return 0;
}
When i tried below code it seems i am getting error in open method but
same program when i tried with ofstream object insted of fstream i got
success . Their was NO already existing file with passed name . Any
idea why?
Chiku
#include<iostream>
#include<fstream>
using namespace std;
int main(void)
{
fstream mystream;
mystream.open("testdirect.txt");
if(mystream.is_open())
{
cout << "file open success"<<"\n";
}
else
{
cout << "failed"<<"\n";
}
return 0;
}