home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!mcsun!news.funet.fi!hydra!klaava!wirzeniu
- From: wirzeniu@klaava.Helsinki.FI (Lars Wirzenius)
- Subject: Re: unbuffered getchar().
- Message-ID: <1992Dec16.193406.22563@klaava.Helsinki.FI>
- Organization: University of Helsinki
- References: <adesai.724348776@class1.iastate.edu>
- Date: Wed, 16 Dec 1992 19:34:06 GMT
- Lines: 26
-
- adesai@iastate.edu (Alpaa Desai) writes:
- >A while ago some one had asked if there was a way to get unbuffered
- >getchar(). I saw a couple of solutions for it which were I thought a
- >bit complicated. Anyway, I found a simple one in Kernighan and
- >Ritchie (second edition) page171. They have given the entire
- >function getchar().
-
- Actually, no. They have written a function that works somewhat like
- getchar, some of the time, and have even called it getchar (stupid,
- IMHO), but it is not the real getchar.
-
- Even so, the function they have does not solve the problem that most
- people are having, since it doesn't disable the operating system's
- buffer, only stdio's, and that is required for the effect of reading
- single characters without the user having to press return.
-
- (Their getchar doesn't mix very well with stdio functions precisely
- because it avoid stdio's buffers.)
-
- Also not that their implementation is for Unix, not a generic one.
- The problem of reading-without-pressing-return stays unsolved (or at
- least the solutions are specific to systems).
-
- --
- Lars.Wirzenius@helsinki.fi (finger wirzeniu@klaava.helsinki.fi)
- MS-DOS, you can't live with it, you can live without it.
-