📄 pipe_parcld_std.c
字号:
/* Using pipe with stdio function */#include "unistd.h"#include "stdio.h"#include "string.h"main(){ int fd[2],pid,n; FILE *fp; char dat[20]="hello world\n",c; pipe(fd); pid=fork(); if(pid==0) { close(fd[1]); fp=fdopen(fd[0],"r"); while((c=fgetc(fp))!=EOF) putchar(c); } else { close(fd[0]); fp=fdopen(fd[1],"w"); fprintf(fp,"parent input %s",dat); }exit(0);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -