Description
For this task, your assignment is to create a C program that utilizes stream-level I/O
functions to perform two main tasks with text files. Firstly, the program should read
the contents of a text file named input.txt and count the number of lines in the file.
Secondly, it should create a new text file named output.txt and write all the lines
from input.txt to this newly created file.
Your program should handle file I/O operations carefully, checking for errors during
file opening and closing processes. It should display the total number of lines in the
input.txt file after processing.
Ensure that your program is well-organized, and comments explaining the logic
behind each step.
Sample Run:
./a.out input.txt
output.txt file has been created.
20 lines have been copied to output.txt