On Mar 3, 2015, at 00:47 , Patrick J. Collins <[email protected]> 
wrote:
>
>  So, I guess this goes along with my confusion about arrays and pointers...

You know what this means:

> float *coefficients = malloc (n * sizeof (float));


Details aside, it means:

> float *coefficients = pointer to a block of memory on the heap


Now this:

> float coefficients [11];


means:

> float *coefficients = pointer to a block of memory on the stack


That’s really all there is to it. Conceptually, C array declarations are a 
twofer: shorthand for a pointer and the stack memory it points to. 
Conceptually, once declared, an array variable is just a pointer.

(That’s the concept. The underlying implementation is a bit more subtle.)



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Objc-language mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/objc-language/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to