Explore BrainMass

Explore BrainMass

    C++ program to process text file

    Not what you're looking for? Search our solutions OR ask your own Custom question.

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    Write a C++ program that reads a text file and counts the characters in each line. The program should display the line number and the length of the shortest and longest lines in the file, as well as the average number of characters per line.

    © BrainMass Inc. brainmass.com November 24, 2021, 1:09 pm ad1c9bdddf
    https://brainmass.com/computer-science/cpp/program-process-text-file-144992

    Attachments

    Solution Preview

    Please note that

    - the attached program (144992.cpp) takes input file name as command line argument.
    - in case input file doesn't contain any newline character but has non-zero size ...

    Solution Summary

    Provided program takes input file name as command line argument, and also handles special case of input file content.

    $2.49

    ADVERTISEMENT