Monday, 21 May 2018

"Writing into File CHAR by CHAR"

"Nice One Program"

#include<iostream.h>
#include<fstream.h>
#include<conio.h>
#include<string.h>

void main()
{       clrscr();     
char ch[]="hello this is the Demo For writing char by char into file";
int l=strlen(ch);
ofstream obj("charbychar.txt");
for(int i=0;i<l;i++)
{
obj.put(ch[i]);

}
cout<<"File Written Char by char:";
obj.close();



getch();
}







No comments:

Post a Comment