CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2008
    Posts
    47

    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;
    }

  2. #2
    Join Date
    Aug 2000
    Location
    West Virginia
    Posts
    7,725

    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.

  3. #3
    Join Date
    Jan 2008
    Posts
    47

    Re: ofstream class - file not seen created in the hard disk

    Thanks, Solved

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured