Hey guys, I have searched high and low for a solution to my problem and it is a little more than frustrating. I am trying to take a string that is within the main function, and write a void function that gives me the most common alpha character used inside the string.
I don't even know where to begin. I am not really asking for someone to really write the function, although it would be nice... But I am more looking for some insight and I guess where to start.
I keep reading about everyone using arrays but I am not sure how to mix a string and an array together like that as I am not too familiar with arrays yet.
Create array of counters for counting occurrences of every possible character, then run through string and do counting. After it is finished run through array and select character for which counter is maximal.
Thanks for the answer rodiongork. I am not too familiar with arrays, but those links help in understanding how they work.
The string is going to be a user input string and it is for a project I am working on.
I am so lost on where to even start because of my noob level when it comes to arrays... Maybe my brain is just on overload right now and I'll figure it out down the road? LOL
This works great and it is the full ASCII range too.
My last question would have to be, how would I get it to display multiple characters? If I have more than one frequent character it displays the closest to the beginning of the ASCII table.
This was really helpful for me but I guess I don't understand it fully. I've tried to manipulate it so that it would give me another frequency (2nd most frequent character, 3rd, etc). How would you edit this code to give you something other than the most frequent character? For this example let's say the 2nd most frequent character.