title: Reversing a vector of strings without the reverse function
body: <p>Currently trying to get a vector of names (strings) to print out in reverse. The reverse function will not be used, so it will be "manually done". So far with what I have, the vector prints forward fine, but when it comes to backwards - it is able to print the first 4 strings backwards fine, but then goes back to printing the rest forward. Have been sitting on it and just can't figure out how to fix it. Thanks.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  
  int main() 
  {  
      std::vector&lt;std::string&gt; names { "Jeff", "Jim", "Jerry", "Lisa",  "Terry", "Tim", "Tiff"};
  
      std::cout &lt;&lt; "This is the vector printing forwards\n";
      for (int i = 0; i &lt; names.size(); i++)
      {
          std::cout &lt;&lt; names[i] &lt;&lt; std::endl;
      }
  
      std::cout &lt;&lt; "This is the vector printing backwards\n";
      for (int i = 0, j = names.size() - 1; i &lt; names.size(); i++, j--)
      {
          std::string temp = names[i];
          names[i] = names[j];
          names[j] = temp;
  
          std::cout &lt;&lt; names[i] &lt;&lt; std::endl;
      }
  }
  </code></pre>