?? mainpopen.c
字號:
#include "unpipc.h"
int
main(int argc, char **argv)
{
size_t n;
char buff[MAXLINE], command[MAXLINE];
FILE *fp;
/* 4read pathname */
Fgets(buff, MAXLINE, stdin);
n = strlen(buff); /* fgets() guarantees null byte at end */
if (buff[n-1] == '\n')
n--; /* delete newline from fgets() */
snprintf(command, sizeof(command), "cat %s", buff);
fp = Popen(command, "r");
/* 4copy from pipe to standard output */
while (Fgets(buff, MAXLINE, fp) != NULL)
Fputs(buff, stdout);
Pclose(fp);
exit(0);
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -