?? file_eof.c
字號(hào):
// file_eof.c --open a file and display it
#include <stdio.h>
#include <stdlib.h> // for exit()
int main()
{
int ch;
FILE * fp;
char fname[50]; // to hold the file name
printf("Enter the name of the file: ");
scanf("%s", fname);
fp = fopen(fname, "r"); // open file for reading
if (fp == NULL) // attempt failed
{
printf("Failed to open file. Bye\n");
exit(1); // quit program
}
// getc(fp) gets a character from the open file
while ((ch = getc(fp)) != EOF)
putchar(ch);
fclose(fp); // close the file
return 0;
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -