Menu

Catching char

2003-01-28
2012-09-26
  • Nobody/Anonymous

    Hey I was wondering how would you get input from the user (for an int(using cin >>)) and if they type in a char then it will tell the user to reinput the number.

     
    • Curtis Sutter

      Curtis Sutter - 2003-01-28

      sounds like a simple do{...}while(); loop  I would personally use a separte function for the job.  Say Input(); or such, then you can send it the Max and Min for the number, and return the number entered when it fits the quota.  I had such a function once, but since my main comp is down, I can't access it right now.

      Curtis

       
    • Curtis Sutter

      Curtis Sutter - 2003-01-28

      Please do not use refresh!  It will lead to a dbl post.

      Curtis

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.