#include
#include
void main()
{
clrscr();
FILE *fp;
char *fname,c;
printf("Enter the file address:");
gets(fname);
fp=fopen(fname,"w");
printf("Enter some thing:");
while((c=getchar())!=EOF)
putc(c,fp);
fclose(fp);
fp=fopen(fname,"r");
printf("The file contain:");
while((c=getc(fp))!=EOF)
putchar(c);
fclose(fp);
getch();
}
0 comments:
Post a Comment