Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: including sys/malloc.h produces errors?



On Tuesday, February 3, 2004, at 12:48 PM, Jerry Pendergraft wrote:

I am dealing with various programs that simply use malloc to allocate
various structures as needed for dynamic data storage.
So the question boils down to, if you have something like

#include <malloc.h>
....

MYstruct *p = malloc(sizeof(MYstruct));
....
free(p);
....

What is the best "standard/correct/portable" header to include instead of
malloc.h ?

I think your choice of stdlib.h will work just fine.

Regards,

Justin

--
Justin C. Walker, Curmudgeon-At-Large *
Institute for General Semantics | If you're not confused,
| You're not paying attention
*--------------------------------------*-------------------------------*
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.