I fixed the counting, knew exactly what was wrong, But I can't change the uppercase and lowercase printing?
- Code:
-
cout << "The number of occurrences of "
<< tolower( letter )
<< " is "
<< lowerCase
<< endl
<< "The number of occurrences of "
<< toupper( letter )
<< " is "
<< upperCase
<< endl
<< "The total number of occurrences is "
<< total;
letter is the char variable that the user has choosen the search for.
lowerCase, upperCase, total are all int variables that counted the "occurrences."
Edit: I am an idoit
I got it all fixed now heres the new code:
- Code:
-
int total = 0;
int lowerCaseCount = 0;
int upperCaseCount = 0;
char lowerCase = tolower( letter );
char upperCase = toupper( letter );
cout << "The number of occurrences of "
<< lowerCase
<< " is "
<< lowerCaseCount
<< endl
<< "The number of occurrences of "
<< upperCase
<< " is "
<< upperCaseCount
<< endl
<< "The total number of occurrences is "
<< total;
with the new variables to catch to upper/lower it prints fine now lolol.
I also had to change bits and pieces when renaming >.<