Hi,

> --- "Ng Wei Gee" wrote:
> What I suggest here is that it would be better to declare your strings as
> arrays rather than pointers.
> --- end of quote ---
> This doesn't seem like it would solve the problem to me, since an array is
just
> a pointer to the first element in the array. Without having a lock on the
> memory, it could be moved.


An array is not quite like a pointer, though most of the time they can be
used interchangably. For e.g., compare these 2 initialisations:

char *strP;
char strP[10];

The first one produces a pointer to a string. In order to store a string,
you'll need to allocate some *real* storage space to store the string
itself, and then use strP and point to it.

The second one produces an array of 10 bytes, with strP already pointing to
strP[0]. You can directly store a string into strP without needing to
allocate some memory.

Regards,
Gee.



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to