I reversed them, but now every time I run the program, it crashes after the function is called stating "MostFrequentChar is being used without being initialized". Isn't the statement in the loop an initialization?
Weird, I'm not getting an error after reversing them... It works correctly for me except for the fact that you don't change the characters to all uppercase or all lowercase first.
And no, the statement in the loop is called an assignment. An initialization is when you assign a value at the time of the variable's declaration.
EDIT: Was just about to suggest the same as TarikNeaj. Maybe your compiler is just really picky. I mean, I suppose you could be using an unitialized MostFrequentChar if you never go through the assignment in the loop due to every value in Frequencies begin equal or less than 0. But you would have to input something like:
THIS SENTENCE WILL RESULT IN NO LETTERS BEING COUNTED BECAUSE THERE ARE NO LOWER CASE LETTERS, LEADING TO AN UNINITIALIZED MOSTFREQUENTCHAR VARIABLE AND UNDEFINED BEHAVIOR WHEN TRYING TO OUTPUT IT.