Jafar Al-Gharaibeh wrote: > I assumed read() never fails the way it is written. It takes input > directly through the standard input from the user. > when I ran the program, the only way to stop it (other than entering "." > ) was to press Ctrl+C or Ctrl+Z. In both cases the program just terminates. > I don't know how to "fail" read() in this case. It keeps asking for more.
The read() procedure fails on EOF. I don't know how to enter EOF in standard input under Windows, but a Ctrl-D in Unix/Linux at the start of a line will (normally) do it. You should see the same effect under windows by redirecting standard input from a file. -- Steve Wampler -- [email protected] The gods that smiled on your birth are now laughing out loud. ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Unicon-group mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/unicon-group
