[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Swarm-Support] C arrays and swarm: strange behaviour (long)
From: |
paul box |
Subject: |
Re: [Swarm-Support] C arrays and swarm: strange behaviour (long) |
Date: |
Wed, 19 Mar 2008 12:05:37 +0930 |
So that wouldn't simply cause a segmentation fault?
On Wed, Mar 19, 2008 at 11:51 AM, Marcus G. Daniels <address@hidden> wrote:
> paul box wrote:
> > -shiftLists {
> > Player * playboy;
> > double avePay[TOTAL]; //
> > double proportion[TOTAL];
> > double trigger[TOTAL];
> > int i, j;
> >
> > The average pay of each strategy is calculated for each list:
> >
> > for (i=SOCIAL; i<=TOTAL; i++) avePay[i] = 0.0;
> >
> One bug is that you can't loop up to and including TOTAL unless you
> extend the arrays by one, e.g. "double avePay[TOTAL+1]. Otherwise <=
> instead of < will run off the end of the array.
> _______________________________________________
> Support mailing list
> address@hidden
> http://www.swarm.org/mailman/listinfo/support
>
--
//////////////////////////
// Paul Box
// Alice Springs, NT Australia
//