Article View: comp.os.msdos.programmer
Article #5759Re: help need in C
From: Thomas Murphy
Date: Sun, 14 Apr 1991 03:45
Date: Sun, 14 Apr 1991 03:45
30 lines
1020 bytes
1020 bytes
In article <7339@munnari.oz.au> ksiew@ecr.mu.oz.au (Kok-Hsien SIEW) writes:
>
> On Turbo Pascal 5.5 I could write the following code:
>
> repeat
> do_calculations;
> until keypressed;
> inchar:=readkey;
> writeln('The key you pressed is ',inchar);
>
In Turbo C I would do it like this:
#include <bios.h>
main()
{
int key;
while(bioskey(1) == 0){
do_calculations
}
key = bioskey(0);
printf("the key you pressed was %d \n" key);
}
pretty short and simple eh?
murph
tmurphy@peruvian.cs.utah.edu
Technical Details
Message-ID:
<1991Apr13.214506.15523@hellgate.utah.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!hellgate.utah.edu!peruvian.utah.edu!tmurphyReferences:
<7339@munnari.oz.au>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!hellgate.utah.edu!peruvian.utah.edu!tmurphy From: tmurphy%peruvian.utah.edu@cs.utah.edu (Thomas Murphy) Newsgroups: comp.os.msdos.programmer Subject: Re: help need in C Message-ID: <1991Apr13.214506.15523@hellgate.utah.edu> Date: 14 Apr 91 03:45:06 GMT References: <7339@munnari.oz.au> Organization: University of Utah CS Dept., Salt Lake City Lines: 30