Saturday, 25 February 2012

Binery File - Write (Simple Program)


#include <iostream>
#include <fstream>
using namespace std;
int main()
{
                char name[50];
                ofstream file("D://Ali.txt",ios::binary);
                cout<<"Enter name :";
                cin.get(name,50);
                file.write((char*)&name,sizeof(name));
                cout<<"File is write"<<endl;
                file.close();
                return 0;
}

No comments:

Post a Comment