Keys
Mark W. Schumann
catfood at NCoast.ORG
Fri Aug 17 07:46:21 AEST 1990
In article <1990Aug16.160043.20584 at eagle.lerc.nasa.gov> vvcns at mars.lerc.nasa.gov writes:
>
> I was wondering if anybody knows how to make a program accept input
>from the keyboard without the user pressing the return key. For example,
>if a user is asked a yes or no question and s/he types a y, the program
>will continue as if return was pressed. I am working on a VAX/VMS system
>v5.1. I would appreciate any help.
>
Actually, this is not exactly a C question. C thinks 'stdin' is
a stream of bytes, not a keyboard. Some operating systems buffer
all keystrokes until <ENTER> or some such is struck, and on those
systems there is no way to do what you are asking. (CPF/400 on
the IBM AS/400 is one notable example near and dear to my heart.)
On VMX 5.1, you can use getch() or one of the runtime library
functions. Try HELP Run-Time to get started.
Good luck!
--
============================================================
Mark W. Schumann 3111 Mapledale Avenue, Cleveland 44109 USA
Domain: catfood at ncoast.org
UseNet: ...usenet.ins.cwru.edu!ncoast!catfood
============================================================
More information about the Comp.lang.c
mailing list