1、显示a.txt文件的内容
#include <stdio.h> int main(void) { FILE *fp; int ch; char filename[FILENAME_MAX]; printf("Please input the filename: "); scanf("%s", filename); if((fp = fopen(filename, "r")) == NULL) printf("aFile oprn failed. "); else { while((ch = fgetc(fp)) != EOF) putchar(ch); fclose(fp); } return 0; }