[Freeciv-Dev] Re: Government file.
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Thu, 20 Jan 2000, Nicolas BRUNEL wrote:
> It did three things :
>
> - I withdraw { } containing one instructions.
> - In a loop, if a test is done which can stop the loop, it is an
> exit condition of the loop. This condition have to be include in the
> test of exit of the loop( && !this_condition) .
>
> Example:
> for(i = 0; i < size; i++)
> if (ToBeFound == Tab [i]) return i;
>
> becomes
>
> for(i = 0; i < size && ToBeFound != Tab [i]; i++);
> return i;
These don't seem identical to me. Is it my C knowledge which is
getting rusty? (ie the first one says nothing about what to return
if no element in Tab is '==' to ToBeFound)
------------------------------------------------------------------
Stig Erik Sandoe stig@xxxxxxxxx http://www.ii.uib.no/~stig/
|
|