Search for question
Question

8. When the user enters the END command in the standard input,

Then your program should first try to open the file for writing. Existing files are completely overwritten (no append), if the file is not present, it should create a new file. If it cannot open the file thus to write, it should display an error message to the standard error to indicate that it was not able to open that file for writing.

The message must contain the filename exactly as it was passed to the argument (i.e., could be a relative or absolute path). For example,

And then terminate with code 3.

Remember to free all the memory allocated to the linked list before terminating the program.

Fig: 1