Explore BrainMass
Share

Counting the number of non-space characters per line

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.

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