Question
An implementation of the program tee.c is available at /student/cmpt214/starter/le4/tee.c. This program resembles the program tee that you have used in Lab exercise 2, except
An implementation of the program tee.c is available at /student/cmpt214/starter/le4/tee.c. This program resembles the program tee that you have used in Lab exercise 2, except that this program has a particular liking to the letters ‘c’, ‘m’, ‘p’, and ‘t’. The program likes to capitalize those letters whenever 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 4 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 don’t 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,
2. echo all of stdin to zero or more files given as command-line arguments,
3. work correctly for inputs greater than 128 characters (do not change the values of
MIN ALLOC SIZE and MIN READ SIZE), and
4. capitalize the letters ‘c’, ‘m’, ‘p’, and ‘t
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored 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