Re: Problem with scanf()/gets()
- From: roberson@xxxxxxxxxxxxxxxxxx (Walter Roberson)
- Date: Fri, 4 Jan 2008 00:58:38 +0000 (UTC)
In article <fljsa6$7e1$1@xxxxxxxxxxxxxxxxxxxxxxx>,
Richard Tobin <richard@xxxxxxxxxxxxxxx> wrote:
In article <flj9n6$j4n$1@xxxxxxxxxxxxxxxxxxxxxxx>,
Walter Roberson <roberson@xxxxxxxxxxxxxxxxxx> wrote:
Do you mean input from a terminal? That may be limited by your
operating system.
As stdin is a stream and there is no exemption for stdin in the
above, an implementation that does not support lines of at least
254 characters on stdin is non-conformant.
The implementation must support 254 character lines on stdin, but you
may not be able to test that with a terminal. The ability of a
particular input device to supply long lines to a program is not
something the C standard can reasonably require.
Suppose a bar-code reader produces data in the form of a short
sequence of digits followed by a linefeed. Surely attaching this to
my computer in such a way that it can be used as standard input
doesn't render my C compiler non-conformant?
However, in such cases, it would not be the *operating system* that
limited the input size below the mandated 254, it would be the
input device's inability to produce additional characters.
It has been many a year since I last encountered a *terminal* that
limited input size -- not since the mid 80's, using CICS
(or a relative thereof) with IBM terminals that were FEP
(front end processor) programmed with input "fields" of fixed length.
--
"I was very young in those days, but I was also rather dim."
-- Christopher Priest
.
- Follow-Ups:
- Re: Problem with scanf()/gets()
- From: Richard Tobin
- Re: Problem with scanf()/gets()
- References:
- Problem with scanf()/gets()
- From: subratasinha2006
- Re: Problem with scanf()/gets()
- From: Richard Tobin
- Re: Problem with scanf()/gets()
- From: Walter Roberson
- Re: Problem with scanf()/gets()
- From: Richard Tobin
- Problem with scanf()/gets()
- Prev by Date: Re: SHA-1 in fully-portable C89?
- Next by Date: creating a function to test bits in a byte, and it returns
- Previous by thread: Re: Problem with scanf()/gets()
- Next by thread: Re: Problem with scanf()/gets()
- Index(es):
Relevant Pages
|