title: How to search a map in C++
body: <p>With <a href="http://www.cplusplus.com/reference/map/map/find/" rel="nofollow noreferrer">this example</a> being the closest I have come to understand how I can search a map in C++, I still need help.</p>
  
  <p>I created a map for a phone book.</p>
  
  <pre><code>map&lt;string,int&gt; PhBook;
  </code></pre>
  
  <p>And now I am letting the user add names and phones to it.</p>
  
  <pre><code>getline(cin &gt;&gt; ws,name);
  cin &gt;&gt; phone;
  PhBook[name] = phone;
  </code></pre>
  
  <p>What I wanna do is to also let the user search for possible names in the map and print "the phone = ...." or the "not found" message accordingly. </p>
  
  <p>So how do I do this? I want the simplest solution since I am a newbie. My difficulty lies to the fact that I don't know how to search the map using the elements(people names).</p>