Saturday, 25 February 2012

File Write (simple Program)


#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main(){
                ofstream file;
                file.open("waseem.txt");
                cout<<"Enter your desired data\n";
                string waseem;
                getline(cin,waseem) ;
                file<<waseem;
                file.close();
                cin.clear();
                return 0;
}

No comments:

Post a Comment