Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You may not use fopen ( ) , fgets ( ) . Using onlinegdb.com, make sure to implent txt files named file 1 . txt
You may not use fopen fgets
Using onlinegdb.com, make sure to implent txt files named filetxt filetxt filetxt
What to do
Write a C program mycat whose behavior resembles that of the system command cat. Unlike the
standard cat, mycat will not work with the standard input. mycat must accept the following
parameters:
mycat must receive at least one parameter, file whose content will be printed on the screen. If more
than one file name is specified, the contents of all of the files will be printed.
mycat must accept any combination of the following switches:
b Number the nonblank output lines, starting at
e Display a dollar sign $ at the end of each line.
n Number the output lines, starting at
s Squeeze remove all empty lines, causing the output to be single spaced. An empty line can
contain one or more whitespace characters eg space, tab, newline, carriage return
You may not use fopen and fgets to read the data from input files.
Line numbering must not be restarted at the beginning f every file.
When both and are specified, only line number should be printed.
Test mycat using the following text files: filetxt filetxt and filetxt Use the following test cases:
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