?? 13-11.txt
字號:
PE 13-11
/* Programming Exercise 13-11 */
#include <stdio.h>
#include <stdlib.h>
#include <console.h> /* Macintosh adjustment */
#define SLEN 256
const char *errmesg[] = {"Usage: %s string filename]\n",
"Can't open file %s\n" };
int main(int argc, char *argv[])
{
FILE *fp;
char line[SLEN];
argc = ccommand(&argv); /* Macintosh adjustment */
if (argc != 3)
{
fprintf(stderr, errmesg[0], argv[0]);
exit(EXIT_FAILURE);
}
if ((fp = fopen(argv[2], "r")) == NULL)
{
fprintf(stderr, errmesg[1], argv[2]);
exit(EXIT_FAILURE);
}
while (fgets(line, SLEN - 1, fp) != NULL)
{
if (strstr(line, argv[1]) != NULL)
fputs(line, stdout);
}
fclose(fp);
return 0;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -