Saturday, 25 February 2012

Binery File - Read (simple Program)


#include <iostream>
#include <fstream>
using namespace std;
int main()
{
                char name;
                ifstream file("D://Ali.txt",ios::binary);
                while(!file.eof() && name!='\0')
                {
                                file.read((char*)&name,sizeof(name));
                                cout<<name;
                }
                cout<<endl;
                cout<<"File is Read"<<endl;
                file.close();
                return 0;
}

No comments:

Post a Comment