请帮我做下C语言编程的填空

来源:百度知道 编辑:UC知道 时间:2024/06/30 15:08:44
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
void WriteText(FILE *);
void ReadText(FILE *);
main()
{ FILE *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!!\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

1 *fp
2 str
3 str

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
void WriteText(FILE *);
void ReadText(FILE *);
main()
{ FILE *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!!\n"); exit(0); }
ReadText(fp);
fclose(fp);
}
/**********found**********/
void WriteText(FILE *fw)
{ char str[81];
printf("\nEnter string with -1 to end :\n");
gets(str);
while(strcmp(str,"-1")!=0) {
/**********found**********/
fputs(str,fw); fputs("\n",fw);
gets(str);
}
}
void ReadText(FILE *fr)
{ char str[81];
printf(&