TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Bill Patterson
from: Julien Pierre
date: 1995-10-04 22:19:06
subject: C Set ++

Hi !

On Sep 28 15:30 95, Bill Patterson of 1:374/2528 wrote:

 BP> help!

 BP> I'm getting really REALLY frustrated with C Set ++. I need 
 BP> to detect a keypress, but none of the input routines will 
 BP> return untill a character and a return is entered. I 
 BP> currently need to detect a carriage return by itself, but 
 BP> will need to detect any key in the future for a "hotkeys" 
 BP> effect. I've tried everything including 
cin >>> setf(ios::unitbuf);
 BP> setbuf(stdin, NULL);

 BP> And more. Nothing will make cin.get() or getchar() or 
 BP> anything return to my code until a character and a return 
 BP> is entered. Help! I'm ready to through this damn compiler 
 BP> out the window!

Use the _kbhit() function. It's described in the C Library Reference.
IMNSHO, you'll need to be a bit more patient than that if you want to
success in programming.

Julien

--- Msgedsq/2 2.2e
* Origin: ChaOS/2 - The Team OS/2 BBS France - +33-1-30472772 (2:320/215)
SEEN-BY: 270/101 620/243 711/401 409 410 413 430 807 808 809 934 955 712/407
SEEN-BY: 712/515 628 704 713/888 800/1 7877/2809
@PATH: 320/215 0 321/1 283/512 280/801 270/101 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.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™.