How do I limit the number of characters entered via cin?
<p>I wish to limit the number of characters that the user can enter, using <code>cin</code>. I might wish to limit it to two characters, for instance. How might I do this?</p>

<p>My code looks like this:</p>

<pre><code>cin &gt;&gt; var;
</code></pre>
