Write two functions so that we can find the total number of


Write two functions, so that we can find the total number of lines in a collection of text files.

a) The first one takes in the name of a text file as its only parameter, reads the file line by line, and returns the number of lines in the file.

b) The second function repeatedly prompts for a file name until the user signifies no more file names by pressing the Enter key with no characters typed in. For each file name, this function calls the one in (a) above and uses the returned value to accumulates a variable. Once there is no more file name entered, the function returns the accumulated value.

Invoke the second function, from function called main().

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Write two functions so that we can find the total number of
Reference No:- TGS01206895

Now Priced at $10 (50% Discount)

Recommended (93%)

Rated (4.5/5)