ofstream class - file not seen created in the hard disk
Iam using Turbo C++ 3.0 - the following code executed without any problems, but
the file not seen created in the hard disk
#include<iostream.h>
#include<conio.h>
#include<fstream.h>
int main()
{
ofstream f;
clrscr();
f.open ("d:\ajmal\ittuz.txt",ios::out);
cout<<"Created";
f<<"This is a file generated by c++ pgm \n ";
f<<"by /n /t Ajmal thagha Muhammed";
cout<<"Wrted to file";
f.close();
cout<<"closed";
getch();
return 0;
}
Re: ofstream class - file not seen created in the hard disk
Code:
f.open ("d:\\ajmal\\ittuz.txt",ios::out);
Also, you are using non-standard headers
Code:
#include <iostream> // no .h
#include <fstream> // no .h
using namespace std;
Re: ofstream class - file not seen created in the hard disk