swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How can I trust in Objective-C?


From: Fabio Mascelloni
Subject: Re: How can I trust in Objective-C?
Date: Wed, 10 Mar 1999 13:40:37 +0100


Gary Polhill wrote:

>
> I thought this might be an array/pointer thing. Arrays are not the same
> as pointers, but I must confess I am not 100% clear about the difference.
>
> I have tried to reproduce your problem declaring local_y to be an array
> and a pointer, but can't. Here's the output of my program
>
> % pointer -b
> Array: 4.0616 3.94155
> Pointer: 4.0616 3.94155
> Array   Pointer
> =====   =======
> 4.0616  4.0616
> 3.94155 3.94155
>
>

Excuse me if I wasn't much clear: local_y is declared as a pointer to float and
allocated through a calloc(2,sizeof(float));
The strange fact is that its values are printed correctly if it is passed as a
parameter to a function,and are wrong if they are printed directly!
Note that that each position is initialized calling  (float)[uniformDblRand
getDoubleWithMin:3.0L withMax:6.0L], so
the two values 452.150452 and 0.00000 are clearly wrong!

Fabio.



                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

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