Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!tank!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.lang.c Subject: Re: ReadKey like Function in C Message-ID: <19174@mimsy.UUCP> Date: 21 Aug 89 00:41:47 GMT References: <148@trigon.UUCP> <225800206@uxe.cso.uiuc.edu> <21371@cup.portal.com> Distribution: na Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 22 >In <19095@mimsy.UUCP> I asked: >>What does `kbhit()' mean when stdin is a socket? How about in a VMS >>batch job? In article <21371@cup.portal.com> Kevin_P_McCarty@cup.portal.com writes: >kbhit() in the absence of a keyboard owned by the process behaves >similarly to pod_bay_doors_open() in the absence of pod bay doors owned >by the process, namely, the behavior is undefined. It is an error to >interrogate a device which does not exist. This is a reasonable definition (although not the one I would choose for those times I have wanted something like this). >>What does getch() do at end of file? >Why, it returns EOF. getch() returns an int, same as getchar(). Again, a reasonable definition---but as others point out, not what MSDOS does. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris