A.空格
B.回车
C.\0
D.逗号
第2题
[注意] 部分源程序给出如下。
请勿改动主函数main和其他函数中的任何内容,仅在函数fun的横线上填入所编写的若干表达式或语句。
[试题源程序]
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 !!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);
}
}
第3题
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!