Path: 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 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 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