The CharPtr points to a location in memory. When you set it equal to 0, you
are pointing at location 0.
Before using the pointer, you must allocate space for the string using
MemPtrNew (LengthOfStringPlusOne) or by setting the pointer equal to a
character array name, such as,
char str[5];
CharPtr s = str;
That should solve your problem.
Regards,
Steve
-----Original Message-----
From: Farzin Ashraghi [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 06, 2000 5:08 PM
To: Palm Developer Forum
Subject: StrIToA
Friends:
How can I define "s" in this structure?:
CharPtr StrIToA (CharPtr s, Long i)
If I define s=0, it gives me the error message "written directly to
memory location NULL". On the other hand, why have I to define
"s" if the whole structure gives me the CharPtr that I need.
Thanks!
Farzin
--
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/