[PD-dev] Pointers changing/corrupting (used to be "signal nan values")
IOhannes m zmoelnig
zmoelnig at iem.at
Wed Apr 27 18:46:45 CEST 2011
-----BEGIN PGP SIGNED MESSAGE-----
On 2011-04-27 18:09, Andrew Hassall wrote:
> When allocating memory with getbytes how do you refer to it as an
> array? I can't seem to set values in the allocated memory using
> *(mybytes+index) like normal.
as long as you only have one-dimensional arrays, the 2 are exactly the
same: a linear memory allocation.
"array" is only how you chose to think of it.
btw, "normal" is something very subjective, but i would access array
"mbytes[index]" rather than "*(mbytes+index)"
>> "x->win=getbytes(x->winsize*sizeof(t_sample));" do you still refer to
>> them in the same way as arrays e.g. *(win+10) to get value at index
don't get me wrong, but a good book on C would probably help :-)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 3636 bytes
Desc: S/MIME Cryptographic Signature
More information about the Pd-dev