X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f Message-ID: <40475F6A.B4F7F9C6@yahoo.com> From: CBFalconer 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: <40470F8C DOT AA25BECD AT yahoo DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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" > > > 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. USE worldnet address!