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

📄 fifopro.c~

📁 word count information using message queues
💻 C~
字号:
#include<stdio.h>#include<sys/types.h>#include<sys/stat.h>#include<fcntl.h>#include<unistd.h>#include<stdlib.h>#include<string.h>int main(){char msg[100];int fd;int ch=1;mkfifo("genfifos",S_IFIFO | 0666,0);// 	{// 	printf("eroor in fifo creation");            //error will be ter if same name is used fo the pipe// 	}// else// 	{// 	printf("good\n");// 	}fd=open("genfifos", O_WRONLY );if(fd==-1)	{	printf("error in opening");	}printf("run fifo.c and then ");while(ch){printf("enter the message \n");fgets(msg,sizeof(msg),stdin);write(fd,msg,sizeof(msg));//printf("do u want to continue yes -1 ==no -0  \n");}close(fd);	return 0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -