[NSRCA-discussion] Chapter-12 computer science.

Martin X. Moleski, SJ moleski at canisius.edu
Tue Jul 3 21:05:14 AKDT 2007


John Pavlick wrote:
> OK, what does this do?

> char foo(void)
> {
>      char cnt, num;
> 
>     for(cnt = 0, num = 0; cnt < 256; cnt++)
>     {
>          num++;
>     }
>     return num;
> }


Initializes cnt and num to 0.

Increments cnt and num from 0 to 255
by passing through the for loop.

Returns 255.


			Marty


More information about the NSRCA-discussion mailing list