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 2004/02/03, at 15:48, 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 ?

/*For C*/
#include <stdlib.h>

//For C++
#include <cstdlib>
using std::malloc

--
Clark S. Cox III
email@hidden
http://homepage.mac.com/clarkcox3/
http://homepage.mac.com/clarkcox3/blog/B1196589870/index.html

[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.

References: 
 >Re: including sys/malloc.h produces errors? (From: Justin Walker <email@hidden>)



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.