I am writing a program that counts the lines, words and letters in a file, i needed help finding out how I could get the letter counts. This is what I have. anyone help Please!
int main(){
string lineBuffer;
int lineCount=0;
int wordCount=0;
int letterCount=0;
int punctCount=0;
int commaCounter=0;
int peroidCounter=0;
int semiCounter=0;
Why do you need a comma, period and semicolon counter if you have a punctuation counter? You can just add 1 to the punct counter every time you see a punctuation mark.
And for a letter counter, you can run a for loop to count everything that's not a punctuation mark or white space.