title: Enter standard input for values of map
body: <p>I'm trying to write a map that takes in an integer as the key and then an x amount of int values that are given to it via standard input. This is my first time working with maps so I'm running into several issues and was wondering if someone could help understand better what I am doing incorrectly. Normally with a vector/array the following would work fine:</p>
  
  <pre><code>int standardInput;
  for (int i = 1; i&lt;=n; i++){
      cin standardInput;
      array[i] = standardInput;
  }
  </code></pre>
  
  <p>I can't get that to work similarly when using a map:</p>
  
  <pre><code>int numberToCompare = 4;
  map&lt;int numberToCompare, int&gt;myMap;
      int standardInput;
      cout &lt;&lt; "Enter numbers: " &lt;&lt; endl;
      for (int i = 1; i &lt;= n; i++){
          cin standardInput;
          myMap.insert(standardInput);
      }
  </code></pre>
  
  <p>I'm still trying to understand about the key and values. The way I understood when reading about maps was that with a map the key is unique unlike multi maps. What I don't know how to do is allow user input to fill the rest of the map. I saw lots of examples online where inside the code people manually entered all of the input doing the following (this goes against what I want to accomplish).</p>
  
  <pre><code>portMap_.insert(pair&lt;string,int&gt;("fourth", 4444)); 
  portMap_.insert(pair&lt;string,int&gt;("fifth", 5555)); 
  </code></pre>
  
  <p>EDIT: To clarify in case I caused some confusion, I'm trying to fill a map with numbers that are given via standard input.  </p>