C Programming
#include
#include
void main()
{
FILE *fp;
char *str,*fname;
clrscr();
fp=fopen("c:\\write.out","w");
printf("Enter some thing:");
gets(fname);
fputs(fname,fp);
fclose(fp);
fp=fopen("c:\\write.out","r");
fgets(str,70,fp);
printf("The file contain \n%s",str);
fclose(fp);
getch();
}
0 comments:
Post a Comment