CSC 442 Homework 2
Write a program that implements the producer-consumer problem using a pipe. The parent will read from the keyboard one line at a time (max 80 characters) and write it into the pipe. The child will read from the pipe and display the content on the screen. This will continue until the user types the character '$' when both processes will display a message ("Good bye") and will exit.
The program will create a pipe and then fork. The child will close the write end of the pipe, the parent will close the read end of the pipe.
The program should use the following system calls:
You may use whatever else you think is necessary (printf, scanf, etc.).
You will need to include the following files: stdio.h, unistd.h, stdlib.h, string.h.