Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!srhqla!demott!pain.UUCP!hung From: hung@pain.UUCP (Rick Hung) Newsgroups: comp.sys.ibm.pc.programmer Subject: Re: help need in C Message-ID: Date: 18 Apr 91 04:11:25 GMT References: <7339@munnari.oz.au> Organization: Public Access Info Network (818/776-1447) Lines: 36 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); > > > But how do I do this in Turbo C and Unix C? > To do that, you would do: while (!operation()) { do_functions(); } printf("Whatever... %s\n",whatever()); or you could do it like: do { do_functions(); } while (!operation()); printf("Whatever... %s\n",whatever()); /l -- pain!hung@demott.com Public Access Information Network (818/776-1447) ++ Waffle BBS v1.64 ++