Re: I need help please!
- From: Flash Gordon <spam@xxxxxxxxxxxxxxxxxx>
- Date: Sun, 09 Mar 2008 11:01:16 +0000
Bill Reid wrote, On 09/03/08 01:32:
Flash Gordon <spam@xxxxxxxxxxxxxxxxxx> wrote in message
news:mjkba5x7s8.ln2@xxxxxxxxxxxxxxxxxxxxxxxxxx
Bill Reid wrote, On 08/03/08 19:15:likely
<snip>
Richard Heathfield <rjh@xxxxxxxxxxxxxxx> wrote in message<snip>
fgets(yn_input,sizeof(yn_input),stdin);...this reply fails to check the result of a function that is veryI sometimes forget which OS I'm using and press ctrl-z to try andunder some circumstances to fail.OK, I like the wording "very likely under some circumstances"...are
THESE the circumstances (reading from the standard input) where
fgets() is "very likely" to fail? Awaiting your response...but yeah, I
acknowledge it COULD fail, possibly, maybe, and possibly maybe
I could make the library function even more "robust" in some way...any
PRACTICAL HELPFUL suggestions?...awaiting your response...
gracefully exit from a program, on some systems that would generate a
failure. I am a user as well as a programming by the way.
OK, THINK REAL HARD...I know this might be tough, but try...
YOU WANT TO "TRY" TO "GRACEFULLY" QUIT THE
PROGRAM BY PRESSING AN UNDOCUMENTED KEY
COMBINATION ABSENT-MINDEDLY, BUT YOU'RE WORRIED
It is documented on some systems I've use a lot as a standard way of exiting at any point.
ABOUT FAILURE TO GET A 'y' OR 'n' INPUT?
DOES THAT MAKE ANY SENSE? How about your untimely
<snip>
Any software written for general consumption should deal with unexpected keystrokes for the simple reason that, in the real world, they are very common.
fflushfflush(stdin);...and this demonstrates that the author either doesn't know whatIt does not work on the machine I'm currently using. I know because Idoes or doesn't know the difference between a stream open for output orMy compiler "does the right thing" for fflush(stdin) so I use it...sorry
update and a stream open for input.
about that, cheif, just did it to irritate you...oh wait, I just did it
(originally)
because IT WORKS AND I DON'T HAVE TO RE-INVENT THE WHEEL
TO SOLVE A PROBLEM THAT ONLY EXISTS ON THIS NEWSGROUP
AND NOT IN "REAL LIFE"...
just tested it. So it DOES NOT ALWAYS WORK IN REAL LIFE.
Next time you MIGHT try just reading the documentation (I know, that
doesn't ALWAYS work, but it's still the REASONABLE man's method
of discovering information about a system)...beats hitting the "any" key
to "test" stuff, anyway...
The point is that you claim that fflush(stdin) just works is wrong. The documentation would not have proved it as it does not mention flushing input streams, so I tested to enable me to state with certainty that it does not work. So you "REASONABLE man's method" fails on a very common system, namely Linux on an x86. I would say that a "solution" that does not work on a very common platform is NOT a reasonable solution.
<snip>
in the standard input...WOULD THAT MAKE YOU HAPPY, YOUSo people who point out your mistakes are trolls. Hmm.
INSUFFERABLE TROLL??!!!?!!
No, "snippy", people who use uncalled-for abusive and insulting
language to harass people who post well-meaning information are
trolls, but you "snipped" out the troll's nastiness for reasons known
OK, so you are a troll by your definition. That clears that up.
only to you...CONSTRUCTIVE criticism is ALWAYS welcome, but
So in your opinion any criticism of your posts is not constuctive, but posting bad advice is a good thing. Well, since you meet your definition of a troll this is not surprising.
please try to keep your disappointment down to a dull roar if I merely
point out that I've previously considered the point you've made and
rejected it on purely practical grounds for my purposes...
Simple enough?
So you want your software to rely on undefined behaviour that does not do what you expect on common platforms. The simple solution is to keep such software to yourself since it is not suitable for posting as advice and when you post it people will keep pointing out the problems with it.
--
Flash Gordon
.
- Follow-Ups:
- Re: I need help please!
- From: Bill Reid
- Re: I need help please!
- References:
- I need help please!
- From: Jim
- Re: I need help please!
- From: Bill Reid
- Re: I need help please!
- From: Richard Heathfield
- Re: I need help please!
- From: Bill Reid
- Re: I need help please!
- From: Flash Gordon
- Re: I need help please!
- From: Bill Reid
- I need help please!
- Prev by Date: Re: Minimum sizes of integral and floating point types
- Next by Date: Re: OK folks, corrected
- Previous by thread: Re: I need help please!
- Next by thread: Re: I need help please!
- Index(es):
Relevant Pages
|