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

📄 pipe_parcld_std.c

📁 Linux大学上机源码学习
💻 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 + -