From: "Patrick Ouellet" <[EMAIL PROTECTED]>
Subject: Memory Allocation
> Is it essential to always use
> MemPtrNew & MemHandleNew routine
> to get some memory, or it's safe enought
> to simply declare variable
> like
>
> int Bidule;
> char Variables;
>
OK as long as you realize that "char Variables;" allocates 1 single byte for
the variable "Variables". If you want a string use something like "Char
Variables[5];" which allocates space for 4 chars plus the terminating NULL.
There are also other considerations. For example, you don't want to declare
a very large variable inside a subroutine where it will be allocated on the
limited sized stack. Neil Rhodes book describes the various size
limitations at http://www.palmos.com/dev/tech/docs/devguide/ch01.htm .
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/