Xref: utzoo comp.lang.c:15207 comp.unix.wizards:13859 Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!husc6!husc4!wen From: wen@husc4.HARVARD.EDU (A. Wen) Newsgroups: comp.lang.c,comp.unix.wizards Subject: Re: printf, data presentation Keywords: printf, terminals, fixed format screens Message-ID: <915@husc6.harvard.edu> Date: 5 Jan 89 00:16:40 GMT References: <19@xenlink.UUCP> <731@picuxa.UUCP> <8332@ihlpl.ATT.COM> Sender: news@husc6.harvard.edu Reply-To: wen@husc4.UUCP (A. Wen) Organization: Harvard University Science Center, Cambridge MA Lines: 25 In article <8332@ihlpl.ATT.COM> knudsen@ihlpl.ATT.COM (Knudsen) writes: >Most OSes make the inkey() function possible, but hardly easy. >I know it takes a lot of ioctl() bashing. ... >My point is that some guru should have figured out how to do >inkey() on the OS in question and put this in the library. >Then ordinary programmers wouldn't have to figure it out >for the zillionth time. But it's very, very easy: (with cbreak mode set) #include char inkey() { int count=0; ioctl(0,FIONREAD,&count); return(count?getchar():NULL); } A. Wen wen@husc4.HARVARD.EDU wen@husc4.BITNET {seismo!harvard!husc4}