title: Reading a password from std::cin
body: <p>I need to read a password from standard input and wanted <code>std::cin</code> not to echo the characters typed by the user...</p>
  
  <p>How can I disable the echo from std::cin?</p>
  
  <p>here is the code that I'm currently using:</p>
  
  <pre><code>string passwd;
  cout &lt;&lt; "Enter the password: ";
  getline( cin, passwd );
  </code></pre>
  
  <p>I'm looking for a OS agnostic way to do this.
  <a href="http://www.codeguru.com/forum/showthread.php?t=466009" rel="noreferrer">Here</a> there are ways to do this in both Windows and *nix. </p>