Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 Ctrl-D (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 sender's 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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions