www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/10/08/12:24:03

Date: Sun, 8 Oct 2000 22:00:04 +0530
Message-Id: <200010081630.WAA01035@midpec.com>
From: Prashant TR <tr AT midpec DOT com>
To: dgrant79 AT hotmail DOT com
CC: djgpp AT delorie DOT com
In-reply-to: <39e03e07_4@news1.prserv.net> (dgrant79@hotmail.com)
Subject: Re: Getting characters from keyboard without CR
References: <39e03e07_4 AT news1 DOT prserv DOT net>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

| From: "David Grant" <dgrant79 AT hotmail DOT com>
| Date: Sun, 8 Oct 2000 02:20:01 -0700
| DJ-Gateway: from newsgroup comp.os.msdos.djgpp
| 
| Can anyone tell me how to get a character from the screen (I mean keyboard)
| without requiring a carriage return?  cin won't work, and neither will
| "&istream get(char c)" funtion.  Thanks.  Sorry I know this is not really
| related to DJGPP, but that's the compiler I'm using, and I like this
| newsgroup.

You could use the "getch ()" function in <conio.h>. Or, you could use
the ncurses library or alternatively use tcsetattr to change the
terminal settings (like Eli suggested).

-- 
Prashant TR <tr AT midpec DOT com>
Web: http://www.midpec.com/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019