实验原理图:
具体代码如下:
#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include<sys/types.h>
#include<string.h>
int main(){
pid_t p1,p2;
int fd[2];
char child1[]="Child process 1 is sending a message!";
char child2[]="Child process 2 is sending a message!";
int len1=strlen(child1);
int len2=strlen(