Object File


CLICK HERE TO DOWNLOAD THIS ANSWER  INSTANTLY $18 Only

 

And the enhancements to be done are

1) Alter the program such that only the correct output is sent to the standard output stream (stdout), while error and help messages are sent to the standard error stream (stderr). (Hint: use fprintf.)
See the expected output listed in the comment at the top of main.c for an example of what should go to stdout.
2) Implement an optional command-line switch '-fFILENAME' that sends program output to a file named FILENAME (i.e., filename specified as a command line argument).
3) Add support for matching arbitrary numbers of words, not just 5. (Hint: use malloc, and don't worry too much about memory efficiency).
4) Safeguard the program from buffer overflow attacks. (Hint: 'gets' is BAD. Use fgets instead, which specifies the maximum number of characters to be read in.)
5) Allow multiple words to be specified per line. (Hint 1: Understand 'strtok'. Hint 2: Be careful about the newline character '\n' at the end of the line.)