Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2000:
[Freeciv-Dev] Re: Government file.
Home

[Freeciv-Dev] Re: Government file.

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Nicolas BRUNEL <brunel@xxxxxxxxxxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Government file.
From: Stig Erik Sandoe <stig@xxxxxxxxx>
Date: Thu, 20 Jan 2000 22:11:19 +0100 (MET)

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/


[Prev in Thread] Current Thread [Next in Thread]