Hi,
The functions calloc, malloc, free are part of the ANSI C library
and are not used in Palm SDK. You can use MemPtrNew() and MemPtrFree
() to replace malloc() and free(), respectively.
In case of calloc you can write an inline version that should work
similar to the ANSI C function calloc().I will give you an example
code.
inline void *calloc(UInt16 num, UInt16 size)
{
void *memory = MemPtrNew(num * size);
if (memory)
{
MemSet(memory, num * size, 0);
}
return memory;
}
and this should match with
inline void free(void *memory)
{
if (memory)
{
MemPtrFree(memory);
}
}
Thanks,
Manikumar K
--------------------------------------------------------------------
Developers' Nation
You've got the questions; we've got the answers.
Visit Us At :http://www.devnation.net for Palm Developer Support
--------------------------------------------------------------------
--- In [EMAIL PROTECTED], [EMAIL PROTECTED] wrote:
> I used it with follow code:
> bmessage=(MQEBYTE *)calloc (n,MQE_SIZEOF(datatype));
> but get error follow message:
> Link Error : MQeDemo.c: 'calloc' referenced from 'MainFormDoMQe'
is
> undefined.
>
>
>
> --
> For information on using the Palm Developer Forums, or to
unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/