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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!