Re: What's wrong ?
- From: Richard Heathfield <rjh@xxxxxxxxxxxxxxx>
- Date: Sat, 08 Mar 2008 09:37:50 +0000
CBFalconer said:
santosh wrote:
CBFalconer wrote:... snip ...
As I explained above, one of the error fouls C89 thru C95, the
other fouls on C99. So his compiler is accepting erroneous code
- no need to encourage it. Of course I didn't think of the
simple solution of the OP not knowing how to signal EOF. But
that is another subject. The code is still WRONG.
The program isn't in error for C90. It merely returns an unspecified
status value. I don't think that invokes undefined behaviour.
Why shouldn't the OS have a provision: I won't display the output
unless the program completes successfully?
Think about it. If your OS behaved like that, you'd be typing blind. Even
if the OS provided input echo (which it might argue "doesn't really count
as output"), you'd still be stuffed, because the program would block for
input without ever once displaying a prompt. Even with a "prompts
crib***", at some point an average user is bound to make a few mistakes
that the program can detect. Noticing your own mistakes (without being
told about them) and keeping track of your retries in your head so that
you can keep your place on the crib*** is going to be extremely tedious
and error-prone. And then, when you finally got sick of it and managed to
work out how to quit the program without any prompts, you'd get an
enormous list of all the prompts you should have had during the program
run...
It ain't ever gonna sell.
--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
.
- References:
- What's wrong ?
- From: Daniel.C
- Re: What's wrong ?
- From: CBFalconer
- Re: What's wrong ?
- From: santosh
- Re: What's wrong ?
- From: CBFalconer
- Re: What's wrong ?
- From: santosh
- Re: What's wrong ?
- From: CBFalconer
- What's wrong ?
- Prev by Date: Re: OK folks, corrected
- Next by Date: Re: OK folks, corrected
- Previous by thread: Re: What's wrong ?
- Next by thread: Re: What's wrong ?
- Index(es):