-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
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 elements as: "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 10?
don't get me wrong, but a good book on C would probably help :-)
fgmadrt IOhannes