little quiz

Neal Weidenhofer neal at denelcor.UUCP
Fri Mar 23 04:10:18 AEST 1984


**************************************************************************

>While we are discussing C, how many people believe that
>
>        for (initial; test; update) statement;
>
>is ALWAYS equivalent to
>
>        initial;
>        while (test) {
>                statement;
>                update;
>                }
>
>how many people can cite the exception to the above rule?  (ie, one
>clearcut case where they produce different results).

	Are you referring to the fact that if "test" is omitted, it is
equivalent to 

	...
	while(1)
	...

Otherwise, K&R says it's the same (p. 202)

		K&R says it
		I believe it
		That settles it	:-)

	Seriously, I am wondering if I broke my compiler by making it work
that way.

			Regards,
				Neal Weidenhofer
				Denelcor, Inc.
				<hao|csu-cs|brl-bmd>!denelcor!neal



More information about the Comp.lang.c mailing list