Question
Write a C++ program that will use the fork, and pipe commands to build an Inter Process Communication program. The program should create a child,
Write a C++ program that will use the fork, and pipe commands to build an Inter Process Communication program. The program should create a child, let the child read data from a disk file, then pass the data to the parent process. The parent process should process the data from the pipe delivered from the child process, and display the result on the screen. The program should be created on a UNIX like operating system.
The data in the file that the child should read should look like the following:
12 + 3
34 - 21
76 * 5
75 / 15
Write a C++ program that will use the fork, and pipe commands to build an Inter Process Communication program.
The program should create a child, let the child read data from a disk file, then pass the data to the parent process.
The parent process should process the data from the pipe delivered from the child process, and display the result on the screen.
The program should be created on a UNIX like operating system.
The data in the file that the child should read should look like the following:
12 + 3 34 - 21 76 * 5 75 / 15
The output should look like the following:
12 + 3 = 15 34 - 21 = 13 76 * 5 = 380 75 / 15 = 5
12 + 3 = 15
34 - 21 = 13
76 * 5 = 380
75 / 15 = 5
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started