Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1exp 11/4/83; site ihuxn.UUCP Path: utzoo!linus!decvax!harpo!floyd!clyde!ihnp4!ihuxn!mort From: mort@ihuxn.UUCP (Dubman) Newsgroups: net.lang.c Subject: Need Help: 1-char input in C Message-ID: <464@ihuxn.UUCP> Date: Wed, 21-Dec-83 21:56:27 EST Article-I.D.: ihuxn.464 Posted: Wed Dec 21 21:56:27 1983 Date-Received: Fri, 23-Dec-83 01:30:42 EST Organization: AT&T Bell Labs, Naperville, IL Lines: 25 I am writing a program in C that requires a menu with four choices, I, D, L, and Q for Insert, Delete, List and Quit. I want to have it so that the program can key an ASCII value for the key from the VT100 terminal without having to have the user type RETURN. I tried using getchar() but inputs an entire line up to the RETURN, returns the first letter, and shoves the rest in a buffer that is emptied the next time getchar() is called. I just read that CP/M's version of C returns the value of the key as soon as the key is typed, but UNIX C (which I am using) waits for a newline. Yet, I know that many C utilities do accept a key as soon as I type it. Any ideas? Thanks in Advance, -- Jonathan Dubman - care of: Mort Dubman AT&T Bell Laboratories ihnp4!ihuxn!mort Naperville, IL.