title: How to set a fixed width with cout?
body: <p>I want to cout a table like output using c++. It should look like this</p>
  
  <pre><code>Passes in Stock : Student Adult
  -------------------------------
  Spadina               100   200
  Bathurst              200   300
  Keele                 100   100
  Bay                   200   200
  </code></pre>
  
  <p>yet mine always looks like</p>
  
  <pre><code>Passes in Stock : Student Adult
  -------------------------------
  Spadina               100   200
  Bathurst               200   300
  Keele               100   100
  Bay               200   200
  </code></pre>
  
  <p>my code for the output</p>
  
  <pre><code>std::cout &lt;&lt; "Passes in Stock : Student Adult" &lt;&lt; std::endl;
  std::cout &lt;&lt; "-------------------------------";
  
      for (int i = 0; i &lt; numStations; i++) {
  
          std::cout &lt;&lt; std::left &lt;&lt; station[i].name;
          std::cout &lt;&lt; std::right &lt;&lt; std::setw(18) &lt;&lt; station[i].student &lt;&lt; std::setw(6) &lt;&lt; station[i].adult &lt;&lt; std::endl;
  
      }
  </code></pre>
  
  <p>how can I change it so it looks like the output at the top?</p>