[comp.lang.c] Help wanted: unbuffered stdin??

732113@sheoak.bcae.oz (732113) (03/30/90)

How can single characters be read from standard input without having to
wait for a newline?

I'm trying to write an improved editor, and I can't even start without
this information.

lucio@proxima.UUCP (Lucio de Re) (04/07/90)

In article <426@sheoak.bcae.oz> 732113@sheoak.bcae.oz (732113) writes:
>How can single characters be read from standard input without having to
>wait for a newline?
> 
>I'm trying to write an improved editor, and I can't even start without
>this information.

You deserve flaming for this! There are as many answers as there are
"C" libraries, how is anyone to tell which answer you want? I'll mail
you a solution if you let me know which of Unix or MSDOS you want the
answer for (I can't vouch for other operating systems) as I am too
lazy to cater for both worlds (and I also don't really like too many
#ifdef's).

----------------------------------------------------------------------
I used to design nuclear reactors and you should see the code that
engineers and scientists come up with. Yuuuck! Spaghetti everywhere.
-------------------------------------------------- (Kenneth L Moore) -
Lucio de Re                        ...uunet!ddsw1!olsa99!proxima!lucio
-------------------------------------------------------- lucio@proxima
                Disclaimer: He must have been joking!

TIM@ENH.Prime.COM (04/11/90)

Re: unbuffered stdin() in C

    Well, it depends. What C compiler and machine are you using? Could be easy,
could be a pain. Feel free to e-mail rather than post (if you like).

/*
Tim Cantin (Tim@ENH.Prime.COM)
Prime Computer, Inc. --  Framingham, MA
*/
#include "stddisclaimer.h"