Comparing strings...

Trent Tobler ttobler at unislc.uucp
Wed Oct 24 05:39:59 AEST 1990


>From article <1990Oct17.030157.460 at ux1.cso.uiuc.edu>, by gordon at osiris.cso.uiuc.edu (John Gordon):
> 
> 	Also, one other thing: for() and while() loops are essentially 
> identical.  The following loops are exactly the same:
> 
> 	#1)
>  	    for(i = 0; i < 100; i++)
> 	    {
> 		body of loop
> 	    }
> 
> 
> 	#2)
> 	   i = 0;
> 	   while(i < 100)
> 	   {
> 	     body of loop
> 	     i++;
> 	   }
> 
> 
> 	Hope it helps.

Please note that for() and while() are identical, except when using the
continue within the body of the loop.  In the while() statement, the
i++ is not performed whereas in the for() statement, it is.


    Trent Tobler



More information about the Comp.lang.c mailing list