请勿改动主函数main和其他函数中的任何内容,仅在函数fun的横线上填入所编写的若干表达式或语句。
include<string.h>
include<stdlib.h>
void WriteText(FILE *);
void ReadText(FILE *);
main()
{
F.ILE *fp;
if((fp=fopen("myfile4.txt", "W"))==NULL)
{
printf("open fail !!/n"); exit(0);
}
WriteText(fp);
fclose(fp);
if((fp=fopen("myfile4.txt", "r"))==NULL)
printf("open fail !!1/n"); exit(0);
}
ReadText(fp);
fclose(fp);
}
/*********found*********/
void WriteText(FILE (1) )
{
char str[81];
printf("/nEnter string with -1 to end :/n");
gets(str);
while(strcmp(Str, "-1")!=0){
/**********found*********/
fputs( (2) , fw);
fputs("/n", fw);
gets(str);
}
}
void ReadText(FILE *fr)
{
char str[81];
printf("/nRead file and output to screen :/n");
fgets(str, 81, fr);
while( !feof(fr)){
/**********found**********/
printf("%s", (3) );
fgets(str, 81, fr);
}
}