down

Harold E. Bamford bamford at ihlpf.ATT.COM
Tue Dec 13 04:34:02 AEST 1988


In article <gables.352 at umigw.miami.edu> slores%gables.span at umigw.miami.edu (Stanislaw L. Olejniczak) writes:
>PLEASE don't flame for posting too simple a question.  I think the following
>SHOULD work, but will not even compile:
>	while ( (c = getchar) != EOF)
>		chcnt++ += (c == '\n');

Without a list of the error messages from the compiler, I can only
guess, but the first thing that strikes me is that "getchar" should
probably be written as "getchar()" as it is a macro.  In my stdio.h,
it is listed as:
	#define getchar()	getc(stdin)

Please, no flames about anything.  Nobody cares.

				Harold Bamford



More information about the Comp.lang.c mailing list