Bonkers

Nigel Rantor wiggly at wiggly.org
Fri May 11 16:08:56 BST 2007


Lusercop wrote:
> On Fri, May 11, 2007 at 02:04:45PM +0100, Nigel Rantor wrote:
>> Jon Nangle wrote:
>>> On Fri, May 11, 2007 at 11:49:38AM +0100, Nigel Rantor wrote:
>>>> example, why passing a char* rather than a char[1024] is likely to be 
>>>> more efficient.
>>> How do you pass a char[1024] in C? Surely arrays will always decay into
>>> pointers anyway.
>> Err, by value?
> 
> Could you give an example of the syntax that you use to pass an array "by
> value"?

Yes, yes, so I forgot that giving parameters set sizes only allows for 
bounds checking. Well done.

>> It was an example, perhaps I should have used C++ where you might want 
>> to pass large objects by value until you realise that they're huge and 
>> copying them onto the stack is a performance hit.
> 
> Sure, except that in C, I can't think of the possible syntax you'd use for
> doing it.

Since C doesn't have objects you can't. Hence why I said "perhaps I 
should have used C++" for an example instead of C.

   n



More information about the london.pm mailing list