Question: The program reads lines from standard input and keeps the last n of them in memory as it goes through standard input. When it gets

The program reads lines from standard input and keeps the last n of them in memory as it goes through standard input. When it gets to an EOF, it prints the last n lines. You may assume n is less than 2,000, and each individual line is no longer than 1,024, including the newline and the end of string char The default n is 10. Write code using getopt() to process the command line option for n. For example, if the command is $ tail -n 20
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
