Alan Connor <(E-Mail Removed)> wrote:
>On 19 Nov 2003 04:27:21 GMT, Grant Edwards <(E-Mail Removed)> wrote:
>>
>> If you decide to write a program, for god's sake don't use C --
>> you're not write a kernel module. Use a high-level language
>> like Python or Perl (gack!)
As always, Grant provides some excellent advice based on a very
good understanding of the context.
>Beg to differ. C is much more versatile and efficient. Why would someone
>want to be limited by P&P? They only SEEM easier. In the long run they
>are harder.
As always, Alan Connor hasn't got a clue. But, I thought it
would be just perfect to quote from an article that Alan posted
to comp.lang.c a few hours back, because it does put this in a
proper perspective. (Not to mention it's good for a laugh, as
our resident expert gives us a great demonstration of how
"versatile and efficient" C programming is!)
Newsgroups: comp.lang.c
From: Alan Connor <(E-Mail Removed)>
Subject: EOF (novice)
Message-ID: <Fizub.5196$(E-Mail Removed) et>
Date: Wed, 19 Nov 2003 01:02:29 GMT
From K&R:
#include <stdio.h>
main()
/* copy input to output */
{
int c;
c = getchar();
while (c != EOF) {
putchar(c);
c = getchar();
}
}
If I am reading the text correctly, this program should
terminate when I enter -1 (EOF as defined on my system,
Linux).
But it doesn't. Just keeps right on trucking.
What gives?
AC
--
Floyd L. Davidson <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska)
(E-Mail Removed)