#include
#include
int main(void)
{
int fd[2];
char send[7] = “Hello!”;
char recv[7];
pipe(fd);
printf(“fd[0] = %d\n”, fd[0]);
printf(“fd[1] = %d\n”, fd[1]);
write(fd[1], send, 7);
read(fd[0], recv, 7);
puts(recv);
return 0;
}
#include
#include
int main(void)
{
int fd[2];
char send[7] = “Hello!”;
char recv[7];
pipe(fd);
printf(“fd[0] = %d\n”, fd[0]);
printf(“fd[1] = %d\n”, fd[1]);
write(fd[1], send, 7);
read(fd[0], recv, 7);
puts(recv);
return 0;
}