Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Program C Write a program for each of the following questions. If your main() function does more than one task, define the necessary functions to
Program C
Write a program for each of the following questions. If your main() function does more than one task, define the necessary functions to take care of those tasks. Files referred to in these exercises are text files. You can assume that file names do not contain whitespaces. 1. Write a function int copy(char const *infile, char const *outfile). This function copies the content of a file whose name is infile to another file whose name is outfile. The function returns 1 if the copy attempt is successful and 0 if it fails. 2. Write a function that takes an input file name and an output file name as parameters then copy the content of the input file to the out file with a line number, starting from 1, at the beginning of each line. The function returns 1 if the copy attempt is successful and O if it fails. 3. Write a function that takes a file name as parameter then returns the number of lines (a line is a sequence of characters ending by a newline), and the number of words (a word is a sequence of characters ending by a whitespace) in that fileStep 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