Wednesday, 1 May 2013

File HAndling In C++ Or OOP'S


#include<fstream.h>
#include<process.h>
int main()
{
char ch;
ofstream of("team.doc");
if(!of)
{
cerr<<"file cannot open correctly";
exit(-1);
}
cin.get(ch);
while(ch!='\n')
{
of.put(ch);
cin.get(ch);
}
return 0;
}

No comments:

Post a Comment