Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a class myPipe by which two processes can exchange the data. For working with the native PIPE channel your class must have attributes: for

Create a class myPipe by which two processes can exchange the data. For working with the native PIPE channel your class must have attributes: for the reading and writing of the stream; and functions:

  1. Which reads the data from the console and writes them to the pipe channel
  2. Which reads the data from the pipe channel console and displays them on the console
  3. Which reads the data from the file and writes them to the pipe channel
  4. Which reads the data from the pipe channel console and writes them to the file

Write a program in which the parent process (main function) will have two children (ch1 and ch2). You must use myPipe channel between them. After running your program there must be displayed the message by which the user can choose the source process (which child will write the data in the channel). After choosing the source process the program there must be displayed another message by which the user can choose the source of the data (console or file). At the destination process (another child) you should decide what to do with the data (display them on the console or write to the file).

It should be noted that your program must work only with integers. Also, you can define some constant variables for choosing the number of elements.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Students also viewed these Databases questions