Thread: Check if input has been recieved

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Oct 2008
    Location
    TX
    Posts
    2,059
    Quote Originally Posted by matsp View Post
    Why not? Unless there is a problem with waiting indefinitely (e.g. some other operation needs to be performed within a certain time), I don't see the problem with waiting. Yes, there are situations that you don't want to wait forever, but in most cases it's just fine to wait.

    --
    Mats
    Sure no harm waiting not like its a resource hog but why wait indefinitely. The only reason for coding something like this would be to provide a shell environment for other programs.

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by itCbitC View Post
    Sure no harm waiting not like its a resource hog but why wait indefinitely. The only reason for coding something like this would be to provide a shell environment for other programs.
    Because there is no reason to NOT wait indefinitely, and it is a much easier way to handle things. If you want a timeout, you need to set things up with a timeout of some sort, then check the result and deal with what happens if you get a timeout. What are you going to do if there is a timeout? Exit, I suppose?

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User
    Join Date
    Oct 2008
    Location
    TX
    Posts
    2,059
    Quote Originally Posted by matsp View Post
    Because there is no reason to NOT wait indefinitely, and it is a much easier way to handle things. If you want a timeout, you need to set things up with a timeout of some sort, then check the result and deal with what happens if you get a timeout. What are you going to do if there is a timeout? Exit, I suppose?

    --
    Mats
    Just a suggestion and as the O/P is content with waiting so be it and of course it keeps things simple. Certainly the code gets complicated if the program needs to either exit after a certain time or supply a default value and continue instead of waiting indefinitely.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Input class project (again)
    By Elysia in forum C++ Programming
    Replies: 41
    Last Post: 02-13-2009, 10:52 AM
  2. can someone help me with these errors please code included
    By geekrockergal in forum C Programming
    Replies: 7
    Last Post: 02-10-2009, 02:20 PM
  3. allegro issues
    By mramazing in forum C++ Programming
    Replies: 1
    Last Post: 01-07-2009, 11:56 PM
  4. HELP!!!!emergency Problem~expert please help
    By unknowppl in forum C++ Programming
    Replies: 9
    Last Post: 08-21-2008, 06:41 PM
  5. check if user input matches a word
    By fakebloo in forum C++ Programming
    Replies: 1
    Last Post: 12-05-2004, 07:12 PM