TIP: Click on subject to list as thread! ANSI
echo: yabbs.unix
to: ALL
from: xenon@yabbs
date: 1993-10-29 00:07:11
subject: re: Loop until keypress

From: xenon@yabbs
To: htoaster@yabbs
Subject: re: Loop until keypress
Date: Fri Oct 29 00:07:11 1993

im compiling under ultrix.  i can get it to wait for a keypress by using 
cbreak(), BUT I want it to run a loop until a key is pressed.  For 
example:

main() {
   while(getchar() == 0)
      printf("LOOPING\n");
}

Even if I set noecho() and cbreak(), it will just wait for a key to be 
pressed without running the body of the loop.  Any ideas? 

--> Xenon

SOURCE: yabbs via textfiles.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.