title: Newbie C++ error (too many arguments in function call)
body: <p>I'm very new to programming and actively trying to teach myself C++. I'm trying to create a simple program that creates a vector, adds indexes in a for loop up to a value of 999, then reduces the vector back down to 0 indexes. My code is producing the VS error &quot;too many arguments in function call&quot;. I've tried looking at other forum posts but I still can't quite understand what I'm doing wrong. My error exists in the second for loop at the line &quot;index.pop_back(y);&quot; here is my code, any additional coding tips help too, thanks.</p>
  <p>My code:</p>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;vector&gt;
  
  int main()
  {
  bool point_reached = 0;
  
  std::vector&lt;int&gt; index = {};
  
  for (int x = 0; x &lt;= 999; x++)
  {
      index.push_back(x);
      std::cout &lt;&lt; index[x] &lt;&lt; std::endl;
  
      if (x == 999)
      {
          point_reached = 1;
          std::cout &lt;&lt; std::endl;
          std::cout &lt;&lt; &quot;point reached!&quot; &lt;&lt; std::endl;
      }
  }
  
      for (int y = 1000; y &gt; 0; y--)
      {
          index.pop_back(y);
          std::cout &lt;&lt; index[y] &lt;&lt; std::endl;
      }
  }
  </code></pre>