ReadKey like Function in C

Chris Torek chris at mimsy.UUCP
Mon Aug 21 10:41:47 AEST 1989


>In <19095 at mimsy.UUCP> I asked:
>>What does `kbhit()' mean when stdin is a socket?  How about in a VMS
>>batch job?

In article <21371 at cup.portal.com> Kevin_P_McCarty at 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 at mimsy.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.lang.c mailing list