C++ Program File Handling Read/Write

This is a simple File Handling Program in C++ for writing and reading a file using streams. This is a part of Mumbai University MCA Colleges Cpp MCA Sem 3



#include<iostream.h>
#include<fstream.h>
#include<math.h>
void main()
{
clrscr();
ofstream fout("Myfile");
fout<<"Ganesh";
fout.close();
ifstream fin("Myfile");
char ch;
while(fin)
{
fin.get(ch);
cout<<ch;
}
fin.close();
getch();
}


Hope this Program is useful to you in some sense or other. Keep on following this blog for more Mumbai University MCA College Programs. Happy Programming and Studying.

1 comment:

  1. it's very simple pro i want some complex pro like
    reading file, append , modify file records
    so plz these pro can solve it and upload here .........

    ReplyDelete