Path: utzoo!attcan!uunet!portal!cup.portal.com!Kevin_P_McCarty From: Kevin_P_McCarty@cup.portal.com Newsgroups: comp.lang.c Subject: Re: ReadKey like Function in C Message-ID: <21371@cup.portal.com> Date: 17 Aug 89 08:51:20 GMT References: <148@trigon.UUCP> <225800206@uxe.cso.uiuc.edu> <1677@crdgw1.crd.ge.com> <19095@mimsy.UUCP> Distribution: na Organization: The Portal System (TM) Lines: 18 In <19095@mimsy.UUCP>, chris@mimsy.UUCP (Chris Torek) writes: >What does `kbhit()' mean when stdin is a socket? How about in a VMS >batch job? 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. kbhit() interrogates the status of a device. stdin is not a device. kbhit() is in the same class as left_mouse_button_pressed(). Neither has anything to do with C language; neither belongs in a language standard; they are idiosyncratic to hardware. >What does getch() do at end of file? Why, it returns EOF. getch() returns an int, same as getchar(). Kevin McCarty