title: Limiting the number of characters of user input
body: <p>I'm trying to limit # of characters a user can input.<br>
  It's not like when user inputs <em>abcde</em>, and I limit the input length to be 3,<br>
  and only <em>abc</em> is taken into account.</p>
  
  <p>Is there a way to <em>physically</em> limit user from inputting more than certain amount of characters?<br>
  For example, if user trys to type <em>12345</em>, and if I limit it to 3 characters, only <em>123</em> gets typed.  </p>
  
  <p>I've tried the following code:  </p>
  
  <blockquote>
    <p>cin.width(5);<br>
    cin >> n;  </p>
  </blockquote>
  
  <p>But I've realized it doesn't <em>physically</em> limit the user input, but only limits the buffersize of input.  </p>
  
  <p>Is there a way to do something like this?  </p>
  
  <p>+) I'm working on Console Application</p>