Answered step by step
Verified Expert Solution
Question
1 Approved Answer
An implementation of the program tee.c is available at / student / cmpt 2 1 4 / 2 0 2 4 / summer / starter
An implementation of the program tee.c is available at studentcmptsummerstarterleteec This program resembles the pro gram tee that you have used in Lab exercise except that this program has a particular liking to the letters cmp and t The program likes to capitalize those letters when ever it finds them. Do not change this. Moreover, there is a number of logical and syntactic errors in this program using the appropriate compiler options in your Makefile will reveal some of the syntactic errors Your task is to find and fix all errors. There are errors in total. Some errors will be easy to fix gcc will point you to the errors and some will require you to read the comments in the code, consult the man pages regarding the C functions you are not familiar with, and use gdb Do not get overwhelmed by the code. The errors are all related to things you have already used and have been discussed in class. The man pages might talk about things you dont understand yet. Ignore those parts. Just make sure that the logic of the program is consistent with what it is trying to do according to the comments and your knowledge of the real tee Once all errors are fixed, make sure to properly test the program. The following tests must pass: echo all of stdin back onto stdout after EOF ctrl D is encountered on stdin, echo all of stdin to zero or more files given as commandline arguments, work correctly for inputs greater than characters do not change the values of MIN ALLOC SIZE and MIN READ SIZE and capitalize the letters cmp and t eet reverse tee points Now that we have working tee program that is a little peculiar around the letters cm p and t we will now create another program called eet. You can start by copying tee.c to eet.c and updating your Makefile. The program eet works much like tee, but instead the output it gives is reversed both on stdout and the files specified via the commandline arguments Your task is to analyze the logic and structure of the original tee.c program, and find the easiest way to have it produce reversed output the solution is much simpler than you think Do not worry if the reversed output starts with an empty line. This is normal it is the final newline character that went into stdin
An implementation of the program tee.c is available at
studentcmptsummerstarterleteec This program resembles the pro
gram tee that you have used in Lab exercise except that this program has a particular
liking to the letters cmp and t The program likes to capitalize those letters when
ever it finds them. Do not change this. Moreover, there is a number of logical and syntactic
errors in this program using the appropriate compiler options in your Makefile will reveal
some of the syntactic errors Your task is to find and fix all errors. There are errors in
total. Some errors will be easy to fix gcc will point you to the errors and some will require
you to read the comments in the code, consult the man pages regarding the C functions you
are not familiar with, and use gdb
Do not get overwhelmed by the code. The errors are all related to things you have already
used and have been discussed in class. The man pages might talk about things you dont
understand yet. Ignore those parts. Just make sure that the logic of the program is consistent
with what it is trying to do according to the comments and your knowledge of the real tee
Once all errors are fixed, make sure to properly test the program. The following tests must
pass:
echo all of stdin back onto stdout after EOF ctrl D is encountered on stdin,
echo all of stdin to zero or more files given as commandline arguments,
work correctly for inputs greater than characters do not change the values of
MIN ALLOC SIZE and MIN READ SIZE and
capitalize the letters cmp and t
eet reverse tee points
Now that we have working tee program that is a little peculiar around the letters cm
p and t we will now create another program called eet. You can start by copying tee.c
to eet.c and updating your Makefile.
The program eet works much like tee, but instead the output it gives is reversed both on
stdout and the files specified via the commandline arguments Your task is to analyze
the logic and structure of the original tee.c program, and find the easiest way to have it
produce reversed output the solution is much simpler than you think Do not worry if the
reversed output starts with an empty line. This is normal it is the final newline character
that went into stdin
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered 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