Question: Using Onlinegdb.com, please write one big C code, and show how to get the necessary outputs! What to do ? Write a C program mywrite
Using Onlinegdb.com, please write one big C code, and show how to get the necessary outputs!
What to do
Write a C program mywrite whose behavior resembles that of the system command write.
mywrite accepts the following parameters:
$ mywrite terminal
where text messages are being sent to another terminal.
mywrite operates by copying lines from stdin of your terminal to stdout of the username's terminal.
Every line typed by the sender must be displayed at the receiver's terminal immediately after the sender
presses the Enter key or closes the connection.
The first line to be displayed on the other terminal must include a greeting message similar to this:
Message from another terminal...
When the user who started mywrite presses CtrlD EOF mywrite closes the connection and displays
the final message on the other terminal:
mywrite must implement a filtering mechanism based on the following list of keywords: apple, pear,
banana, plum. If one of these keywords appear as a part of the input line, mywrite will produce a
relevant warning on the senders terminal and will not send that line to the receiver. Here's an example of
an input line and a corresponding warning:
I like bananas!
You entered a prohibited word: banana. Your message will not be sent.
What to submit?
A single C source code file with your work.
Several screenshots in PNG or JPG format showing two parallel terminal sessions with mywrite
message exchange.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
