Date: Thu, 1 Jan 1998 18:18:55 +0200 (IST) From: Eli Zaretskii To: Noam Rotem cc: djgpp AT delorie DOT com Subject: Re: Escape Sequences / Reading from Console In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Thu, 1 Jan 1998, Noam Rotem wrote: > >What's wrong with `getc'? It can read single characters as well, if > >you switch stdin to binary mode (use `setmode') and make it unbuffered > >(use `setvbuf'). Did you try it? > > I can't use 'setmode' under UNIX. This is what's wrong with it... Then surround the call to `setmode' with #ifdef __MSDOS__ ... #endif. Unix doesn't need the call at all, so it will work on Unix also. > Is there any other way to do it (using ANSI C / stdio.h)? ANSI C doesn't specify a way that would guarantee to return one character at a time. Sorry, this is one of the cases where some OS dependence is necessary.