Explore BrainMass
Share

Counting the number of non-space characters per line

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

Please help with the following problem involving programming languages.

Write a C++ program that counts the number of non-space characters per line in the specified file. Program should accomplish this via a function that receives a string read from text file and returns the count of the non-space characters in the string to the main function. Again, this has to be done without using the cstring library functions.

© BrainMass Inc. brainmass.com October 17, 2018, 3:50 am ad1c9bdddf
https://brainmass.com/computer-science/cpp/writing-c-program-in-command-line-440110

Attachments

Solution Preview

Problem: Write a C++ program that counts the number of non-space characters per line in the specified file. Program should accomplish this via a function that receives a string read from text file and returns the count of the non-space characters in the string to the main function. Again, this has to be done without using the cstring library functions.

Solution:
Please find ...

Solution Summary

The following problem helps with a problem regarding programming languages. The attached program accepts the file name as it's command line argument. It makes use of getline function to read the input file line by line, and has been tested using GNU C++ compiler (g++).

$2.19
Similar Posting

coding a word counter

Seeking help with coding a word counter. I have 2 codes that I'm working with and I not sure where I went wrong with them. Text file with code provided..Visual C++

View Full Posting Details