标签:函数 显示 fgetc printf mic clu http filename can
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.\n"); else { while((ch = fgetc(fp)) != EOF) putchar(ch); fclose(fp); } return 0; }
标签:函数 显示 fgetc printf mic clu http filename can
原文地址:https://www.cnblogs.com/liujiaxin2018/p/14873731.html