What I am trying to do:
Counting the frequency of words occurring in a text file and printing them in order of frequency. I have successfully solved the problem using vectors (copying data from map to vector, then sorting). Now I am trying to do it with multiset, which should sort the data automatically (I think).
What my problem is:
The code that is written in bold; the back_inserter() does not seem to be functioning with multiset. Is there a function for this or a simpler way?
Why use multiset? What is wrong with set? Also you never declared a variable called words_v.
there is no overload for the squarebrackets in multiset. And words_m stores pairs of type <string, int> but you are using it like it stores just integers