Article View: comp.std.c
Article #3699Re: gets() and getchar
From: Jens Andreasen
Date: Thu, 10 Aug 1995 18:50
Date: Thu, 10 Aug 1995 18:50
34 lines
1759 bytes
1759 bytes
On 9 Aug 1995, Richard A. O'Keefe wrote: > Jens Andreasen <jens-and@dsv.su.se> writes: > >Well, getchar() seems to be a bit on the implementation defined side and > >gets() can be considered playing russian roulette :-| --------< lots of nice suggestions deleted >--------- > Better yet, you could learn about fgets(). ---------------< snip >------------------------- [Reaching out for 'Schildt', study.. , mumble mumble..] Yes, thats it, thankyou. Why wasn't gets implemented in this way? > What do you mean "hang"? Come to that, just _which_ buffer do you mean? That's the point. I'm talking about systems in general, not this or that welldefined system. So I can't tell you anything about the hardware. The system need not even to be designed yet. But yes, I am considering different types of terminals. > - what's a user? C is used on systems that _have_ no user. I agree on that, but very often there is some kind of input from the horrible outside world of undefined behavior. I would like to be able to reject all input that is *not* defined as legal in the program.. ..and fgets seems to be able to deliver some of the goods. // Jens M Andreasen (not responding to this thread anymore).
Technical Details
Message-ID:
<Pine.ULT.3.91.950810200159.11767A-100000@mars>Path:
arc1-ca.pugleaf.net!news.kth.se!mars!jens-andReferences:
<Pine.ULT.3.91.950807194041.19202A-100000@mars> <409hdq$ib2@goanna.cs.rmit.edu.au>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!news.kth.se!mars!jens-and From: Jens Andreasen <jens-and@dsv.su.se> Newsgroups: comp.std.c Subject: Re: gets() and getchar Date: Thu, 10 Aug 1995 20:50:39 +0200 Message-ID: <Pine.ULT.3.91.950810200159.11767A-100000@mars> References: <Pine.ULT.3.91.950807194041.19202A-100000@mars> <409hdq$ib2@goanna.cs.rmit.edu.au> NNTP-Posting-Host: mars.dsv.su.se Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Sender: jens-and@mars In-Reply-To: <409hdq$ib2@goanna.cs.rmit.edu.au>