Monday, December 10, 2012

CPP Program to count words in a File

The below program is c++ program to count the number of words in a given input file. The program will take space character as a word separator. It is a very simple file handling program written in c++. It just reads the file path from the user and verifies whether the file is existed. If the file does not exist, the program simply gives a message "File does not exist". If the file is existed then it reads each character from the file and checks if the character is a space. If the character is a space then it would be counted as word and the counter variable will be incremented. Once the it reaches the end of the file, it will displays the total count of the words in the given file. 

Click here to know more about the project. 

 Visit Projects page of learningmela.com to download more projects.

No comments:

Post a Comment