title: Using setw is failing inside of a for loop
body: <p>Suppose there is an array of structs called machine with elements drink, price.</p>
  
  <pre><code>for(int i = 0; i &lt; 10; i++)
  {
      cout &lt;&lt; i+1 &lt;&lt; ". " &lt;&lt; machine[i].drink;
      cout &lt;&lt; setw(20) &lt;&lt; machine[i].price &lt;&lt; "\n";
  }
  </code></pre>
  
  <p>This isn't working the way I would normally expect setw to work, and it's formatting my spaces in much the same way that \t would do (not creating columns but rather uneven spacing).</p>
  
  <p>Any help here?</p>