欢迎使用题易搜网站

题易搜

在线题库

[单选] 

13、下面程序运行后,屏幕显示File open error!,则可能的原因是(    )。

#include <stdio.h>

main(){ 

FILE *fp;  char str[256]; 

fp = fopen("test.txt", "rt"); 

if(fp==NULL)  

{ printf("File open error!");    return;  } 

fscanf(fp,"%s",str); 

fclose(fp);}

发布时间:2022-09-12 0次

当前工作目录下的test.txt文件是空文件

函数fopen()的参数是错误的

当前工作目录下没有test.txt文件

test.txt文件已经打开

您需要登录才可以下载或查看,没有账号?会员注册