Re: Malloc()
Re: Malloc()
- Subject: Re: Malloc()
- From: Jim Correia <email@hidden>
- Date: Wed, 3 Apr 2002 15:07:32 -0500
On Wednesday, April 3, 2002, at 01:25 PM, Kaelin Colclasure wrote:
Following your logic above, better to use sizeof (*pointer).
I know it is an inconsistent ruleset when compared to each other, but
when
applied consistently throughout my code it has caught/prevented bugs
from
shipping.
By using indirection you eliminate the inconsistency, and further
reduce the
chance of the class of error you allude to above.
That makes sense. (Honestly, I didn't know you could do indirection in
the sizeof operator, but upon reflection, I guess I had no valid basis
for that assumption, and have just re-read what the C++ spec has to say
about sizeof - (I don't have the latest C spec handy)).
Jim
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
References: | |
| >Re: Malloc() (From: Kaelin Colclasure <email@hidden>) |