[comp.sys.ibm.pc.programmer] help need in C

ksiew@ecr.mu.oz.au (Kok-Hsien SIEW) (04/13/91)

 
 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?
 
  Help needed for this stupid pascal programmer.
 
  thanks in advance.......

hung@pain.UUCP (Rick Hung) (04/18/91)

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 ++