Below is my current code. It prints out all of the characters in the specified file but not in order. I have been looking online and have noticed that people suggest to copy the map into a vector to sort it. However, I am having a problem successfully implementing this and was looking for some assistance.
First, to make this easier for us to read and comment on, please go back and edit your post and add code tags. Highlight the code in your post and click the Format button that looks like "<>". This will display indentation and provide line numbers.
As far as your problem, what input are you using, what output are you getting and what output are you expecting? Your code looks correct to me , but I'm not sure I know exactly what you are looking for.
In any case, I doubt you need to copy anything to a vector. In the most obvious case the map should take care of the sorting for you. I guess it depends on what you are actually trying to sort.
Edit: Seeing JLBorges' post (I got ninja'd), I can see what you may have been trying to do. I didn't think about printing out the characters in order of frequency.
What I am trying to do is to print a string taken from a file I have in the order of frequency of characters. I am currently getting all of the correct frequencies of characters its just that they are unordered and that is what I need help with.