delorie.com/archives/browse.cgi | search |
X-Authentication-Warning: | delorie.com: mail set sender to djgpp-bounces using -f |
Message-ID: | <40475F6A.B4F7F9C6@yahoo.com> |
From: | CBFalconer <cbfalconer AT yahoo DOT com> |
Organization: | Ched Research |
X-Mailer: | Mozilla 4.75 [en] (Win98; U) |
X-Accept-Language: | en |
MIME-Version: | 1.0 |
Newsgroups: | comp.os.msdos.djgpp |
Subject: | Re: What is portable equivalent of getch()? |
References: | <c270na$1jhh$1 AT alpha2 DOT radio-msu DOT net> <40470F8C DOT AA25BECD AT yahoo DOT com> <c278s4$1n04$1 AT alpha2 DOT radio-msu DOT net> |
Lines: | 28 |
Date: | Thu, 04 Mar 2004 17:32:23 GMT |
NNTP-Posting-Host: | 12.76.139.77 |
X-Complaints-To: | abuse AT worldnet DOT att DOT net |
X-Trace: | bgtnsc05-news.ops.worldnet.att.net 1078421543 12.76.139.77 (Thu, 04 Mar 2004 17:32:23 GMT) |
NNTP-Posting-Date: | Thu, 04 Mar 2004 17:32:23 GMT |
To: | djgpp AT delorie DOT com |
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
Reply-To: | djgpp AT delorie DOT com |
Anthony wrote: > "CBFalconer" <cbfalconer AT yahoo DOT com> > > > You can wait for an ENTER (cr) keypress, with something like: > > > > int flushln(FILE *f) > > { > > int ch; > > > > while ((EOF != (ch = getc(f)) && ('\n' != ch)) continue; > > return ch; > > } /* flushln */ > > > > which is capable of detecting EOF. > > > Ok, what if I want no echo? I mean, if user press 'a''a''a''cr' > I want 'a'-s not to be printed on the screan? Tough. It's not under your control in a portable program. You can reduce portability by making further assumptions, such as POSIX. -- Chuck F (cbfalconer AT yahoo DOT com) (cbfalconer AT worldnet DOT att DOT net) Available for consulting/temporary embedded and systems. <http://cbfalconer.home.att.net> USE worldnet address!
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |