title: For-Loop Skipping getline C++
body: <p>I'm having a problem where my for-loop skips over the getline function. If I replace it with <strong>std::cin</strong> then it works, so I think it's something related to what I inputted in getline.</p>
  
  <p>Here's my code.</p>
  
  <pre><code>void setLocations(int amount) {
      locations = new std::string[amount];
      locations[0] = startingLocation;
  
      // starts at 1 because we want to skip first index. The amount is set at 2 by default, so the loop should iterate at least once.
      for (int x = 1; x &lt; amount; x++)
          std::getline(std::cin, locations[x]);    
  }
  </code></pre>