[TUHS] C declarations.

Arthur Krewat krewat at kilonet.net
Mon May 15 09:34:01 AEST 2017


On 5/14/2017 7:06 PM, Ron Natalie wrote:
> array kludge
Is it really a kludge? It's a pointer.

int array[128];

Want to reference the array in a memcpy? Do: memcpy(destination, array, 
sizeof(array));

Want to reference an element in the array? array[element #]

Want to pass (a reference to) said array to a function? function(array)

Not sure what the kludge is.

I think C is more consistent when it comes to arrays than a lot of other 
languages. At least with C you KNOW it's a pointer to the original.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20170514/acf3111e/attachment.html>


More information about the TUHS mailing list