#include<stdio.h>
void main()
{
FILE *pt;
char
ch[100],c;
int i;
pt=fopen("test.txt","w");
if(pt==NULL)
puts("File
Opening error");
else
{
printf("Enter
a line of text>> ");
gets(ch);
for(i=0;ch[i]!='\0';i++)
fputc(ch[i],pt);
}
fclose(pt);
}
Download Source Code
No comments:
Post a Comment