⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 showfile.c

📁 The art and science of c_source code!
💻 C
字号:
/* * File: showfile.c * ---------------- * This program reads a file name from the user and displays * the contents of that file on the console. */#include <stdio.h>#include "genlib.h"#include "simpio.h"/* Main program */main(){    string filename;    FILE *infile;    char ch;    printf("This program displays an input file.\n");    while (TRUE) {        printf("Input file name: ");        filename = GetLine();        infile = fopen(filename, "r");        if (infile != NULL) break;        printf("Can't open the file %s.  Try again.\n", filename);    }    while ((ch = getc(infile)) != EOF) {        putc(ch, stdout);    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -