down

K.LAUX rkl1 at hound.UUCP
Tue Dec 13 04:22:37 AEST 1988


In article <45370 at yale-celray.yale.UUCP>, wald-david at CS.YALE.EDU (david wald) writes:
> 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');
> 
> Flame?  Us?  Never.
> 
> You can't assign to a ++ expression.
> 

	Of course you can!  For example, a simple string copy function:

copy_string (from, to)
char *from;
char *to;
{
	while (*to++ = *from++)
		;
}

--rkl



More information about the Comp.lang.c mailing list