title: expected primary-expression before ‘.’ token in ordered_map()
body: <p>I want to insert paragraph or article content and process each word. Below I am trying to get each string and then get occurance of it. Finally I want word with max occurance. I am new to c++. Right now I have inserted statically two strings.
  Which gives error <code>expected primary-expression before ‘.’ token</code>. Code is below:
  `</p>
  
  <pre><code>#include &lt;string&gt;
  #include &lt;iostream&gt;
  #include &lt;unordered_map&gt;
  
  int main()
  {
      typedef std::unordered_map&lt;std::string,int&gt; occurrences;
      occurrences s1;
      s1.insert(std::pair&lt;std::string,int&gt;("Hello",1));
      s1.insert(std::pair&lt;std::string,int&gt;("Hellos",2));
  
      //for ( auto it = occurrences.begin(); it != occurrences.end(); ++it )  this also gives same + additional " error: unable to deduce ‘auto’ from ‘&lt;expression error&gt;’" error
      for (std::unordered_map&lt;std::string, int&gt;::iterator it = occurrences.begin();//Error is here
                                                      it != occurrences.end(); ////Error is here
                                                      ++it)
      {
          std::cout &lt;&lt; "words :" &lt;&lt; it-&gt;first &lt;&lt; "occured" &lt;&lt; it-&gt;second &lt;&lt;  "times";
      }
  
      return 0;
  }
  </code></pre>
  
  <p>Where is the mistake?</p>