A question of style
Triantaphyllos Byron Rakitzis
tbrakitz at phoenix.Princeton.EDU
Sat Dec 2 19:03:34 AEST 1989
>>while (c = getchar(), c != EOF)
>>{
>
>The code above could be written as
>
> while (c = getchar && c != EOF) {
Mark H. Colburn mark at Minnetech.MN.ORG
Open Systems Architects, Inc.
No!! What if getchar returns the null character? Then this test fails.
The usual C syntax for the above statement is
while ((c = getchar()) != EOF)
{
blah blah;
Okay?
--
"C Code."
"C Code run."
"Run, Code, run!"
Byron Rakitzis. (tbrakitz at phoenix.princeton.edu ---- tbrakitz at pucc.bitnet)
More information about the Comp.lang.c
mailing list