Question
c++ create a cat.cpp. You are NOT allowed to use the exec, system, popen, and pclose system calls or functions in your implementation. You are
c++ create a cat.cpp.
You are NOT allowed to use the exec, system, popen, and pclose system calls or functions in your implementation. You are not allowed to call the existing cat implementation. You must supply your own implementation that uses low-level I/O. Low-level file I/O is a requirement.
c++ create a cat.cpp that does following:
When user types in command cat filename.txt, it allows user to enter an input and the system will echo back the user input and When ctrl + d is pressed, it exits out of cat mode and displays the contents of the file.
For example:
Assuming that filename is a text file with "c++ rules"
$ ./cat - filename
s <- user input
s <- automatically echoes back user input
dqewfqwef <- user input
dqewfqwef <- automaticcally echoes back user input
c++ rules <- When ctrl + d is pressed, it exits out of cat mode and displays the contents of the file.
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