title: Constant Tabspace between words in C++
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2485963/c-alignment-when-printing-cout">C++ alignment when printing cout &lt;&lt;</a>  </p>
  </blockquote>
  
  
  
  <p>I am writing a set of words in an output file . I have left three tabspaces using '\t' character between the words . But at times when the words are too small or too large there seems to be a problem with the alignment. How to give a constant space between words which would work even when the words are small ? </p>
  
  <p>Here's what i am talking about. </p>
  
  <pre><code>    Word:elpmas         Count:1
      Word:This           Count:4
      Word:pmasel         Count:1
      Word:is         Count:1
      Word:sample         Count:1
      Word:sentence           Count:1
      Word:si         Count:1
      Word:a          Count:1
  </code></pre>
  
  <p>I want to have a constant space between the words and the counts. I currently use </p>
  
  <pre><code>cout&lt;&lt; "Word:"&lt;&lt; hash-&gt;key &lt;&lt;"\t\t\t" &lt;&lt; "Count:" &lt;&lt; hash-&gt;value &lt;&lt;endl;
  </code></pre>
  
  <p>Help me out.</p>