home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / c / 12511 < prev    next >
Encoding:
Internet Message Format  |  1992-08-18  |  1.2 KB

  1. Xref: sparky comp.lang.c:12511 comp.programming:2378
  2. Path: sparky!uunet!mcsun!Germany.EU.net!unido!open.de!mailbox!teddy!germany!open!ruhr.de!horga!erni.bs.open.de!germal!germal.bs.open.de!gm
  3. From: gm@germal.bs.open.de (Gerald Malitz)
  4. Newsgroups: comp.lang.c,comp.programming
  5. Subject: Re: A LITTLE BRAINTEASER...
  6. Message-ID: <UuUwr*iT1@germal.bs.open.de>
  7. Date: 17 Aug 92 13:33:12 GMT
  8. References: <aet.713608023@munagin> <Bswt31.7zC@research.canon.oz.au> <josef.713800013@uranium>
  9. Lines: 24
  10. X-Newsreader: Arn V1.00 beta rel2
  11.  
  12. In article <josef.713800013@uranium>, Josef Moellers writes:
  13.  
  14. > In <Bswt31.7zC@research.canon.oz.au> andy@research.canon.oz.au (Andy Newman) writes:
  15. > >aet@mullian.ee.mu.OZ.AU (bert thompson) writes:
  16. [...]
  17. > >>    char ch = getchar();
  18. > >        ^^^^^^^
  19. > >    NOT AGAIN!
  20. [...]
  21. > >So how may machines does this work on? Want to run it on something
  22. > >without memory protection and let the little sucker recurse and
  23. > >recurse...
  24. > It'll run perfectly on systems that have signed characters!
  25.  
  26.     No, it won't.
  27.  
  28. > EOF usually is -1, so '\377' will expand to -1.
  29.  
  30.     '\377' may appear at any place within a file.  So (ch == EOF)
  31. may be TRUE long before you reach EndOfFile.
  32.  
  33.     regards, Gerald.
  34.