Re: Article on Herbert Schildt, author of C Unleashed, repaired on wikipedia
- From: Randy Howard <randyhoward@xxxxxxxxxxxxxxxxx>
- Date: Sat, 12 Jan 2008 15:50:23 GMT
On Sat, 12 Jan 2008 06:12:03 -0600, gw7rib@xxxxxxx wrote
(in article
<1b3db33e-e4ef-4dac-9de6-841a6d092207@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>):
On 9 Jan, 23:59, Phlip <phlip2...@xxxxxxxxx> wrote:
gw7...@xxxxxxx wrote:
It's been a while, but I suspect we mean printf _won't_ flush its line
_unless_
<stdio.h> sees a \n on the end of its string.
A quick test shows it working fine in DOS. Prints the prompt, then
asks for input.
(Are you channeling Herb S now?;)
If by "DOS" you mean the Command Prompt in WindowsXP, that follows the same
console model as DOS Classic. On a Unix terminal, such as Linux's BASH, you
might get different "turnaround". Or you might not! Thanks for doing the
experiment, but you can never judge well-behaved programs just by
experimenting!
I think we're talking at cross purposes here. I took your comment (at
the top of this post) to mean that printf was guaranteed not to print
its output unless it came across a \n. This was contrary to how I
remembered it working under DOS, and a quick test (admittedly this
time under the Windows XP command prompt, as you guessed correctly)
bore this out. Of course this is no guarantee that it will work the
same way on different systems (or even the same system) but it refutes
what I thought you'd said.
The problem is that using what DOS or Windows "does" to extrapolate
what will happen everywhere isn't that useful. In fact, it has let a
great many programmers into making assumptions that turn out not to be
true in general.
A lot of Windows programmers that have moved to Linux, OS X, and other
lesser known platforms have been struck by the sudden realization that
code that "just worked" under MS platforms didn't work anymore.
Of course, after getting the appropriate changes in, they wind up with
code that will work on all the platforms, including Windows. If they
had been exposed to multiple platforms when they were first starting
out, some of those lessons would have come naturally, instead of having
to unlearn habits that were only valid with MS compilers and libraries.
--
Randy Howard (2reply remove FOOBAR)
"The power of accurate observation is called cynicism by those
who have not got it." - George Bernard Shaw
.
- Follow-Ups:
- References:
- Article on Herbert Schildt, author of C Unleashed, repaired on wikipedia
- From: spinoza1111
- Re: Article on Herbert Schildt, author of C Unleashed, repaired on wikipedia
- From: Stephen Howe
- Re: Article on Herbert Schildt, author of C Unleashed, repaired on wikipedia
- From: spinoza1111
- Re: Article on Herbert Schildt, author of C Unleashed, repaired on wikipedia
- From: Richard Heathfield
- Re: Article on Herbert Schildt, author of C Unleashed, repaired on wikipedia
- From: gw7rib
- Re: Article on Herbert Schildt, author of C Unleashed, repaired on wikipedia
- From: Phlip
- Re: Article on Herbert Schildt, author of C Unleashed, repaired on wikipedia
- From: gw7rib
- Re: Article on Herbert Schildt, author of C Unleashed, repaired on wikipedia
- From: Phlip
- Re: Article on Herbert Schildt, author of C Unleashed, repaired on wikipedia
- From: gw7rib
- Article on Herbert Schildt, author of C Unleashed, repaired on wikipedia
- Prev by Date: Re: A note on computing thugs and coding bums
- Next by Date: Re: A note on computing thugs and coding bums
- Previous by thread: Re: Article on Herbert Schildt, author of C Unleashed, repaired on wikipedia
- Next by thread: Re: Article on Herbert Schildt, author of C Unleashed, repaired on wikipedia
- Index(es):
Relevant Pages
|