|
-
October 27th, 2010, 05:59 PM
#1
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: ut);
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;
}
-
October 27th, 2010, 06:23 PM
#2
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;
Last edited by Philip Nicoletti; October 27th, 2010 at 06:26 PM.
-
October 31st, 2010, 06:59 PM
#3
Re: ofstream class - file not seen created in the hard disk
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|