Hello,

I'm trying to write a function that uses a C++ string object as its argument, and returns the character that appears most frequently in the string. How would I write this? Is a for loop necessary?

Thanks for the help.

Think about how you would do it with pencil and paper. Find a long bit of text in a book or magazine, then try different approaches to counting the letters.

Yes, for loop(s) would be a good idea. You could do this with nested loops, or, if you set up your counting method correctly, you could do it with one loop, completing the work in just one pass.