title: Integer input restricted to four digits only
body: <p>I'm doing a problem where it asks to input an account number, which consists only of four digits. This has to be accomplished with basic beginner C++.</p>
  
  <p>I need to figure out a way to restrict the input of the integer to four digits. A user should be able to put in 0043 or 9023 or 0001 and it should be an acceptable value....</p>
  
  <p>I think I know how to accomplish it with a string.... getline(cin,input) and then check if input.length()==4?</p>
  
  <p>But I've no idea how I would even do this with an integer input.</p>