#include<stdio.h> #include<stdlib.h> int main(void) { FIEL *fp; char filename[20]; printf("文件名:"); gets(filename); fp = fopen(filename,"r"); if(fp==NULL) { printf("打开文件失败!"); exit(1); } fclose(fp); return 0; }