Subject: Pointer Assignment Problem
From: "Del Ventruella" <[EMAIL PROTECTED]>
Date: Sat, 12 Nov 2005 19:38:30 -0000
X-Message-Number: 10

I am trying to assign two pointers to the same character in two different strings. If I assign the pointers once, they seem to work. If I attempt to reassign the pointers to another location in the same character strings, I get an error. One of the strings is a char * passed to the function. The other is a pointer to a record structure.

The error is (in abbreviated terms):

"wrote to memory location in the stoarge heap. Use special functions calls to access this area."

The problem seems to be caused if I assign the char pointers "try1" and "try2" to another location in the same strings. It doesn't happen with the first assignment.


The code that causes the problem looks like:

        <SNIP>
char* try1;
        <SNIP>
                *try1=p->TrName[0];
        <SNIP>

Exactly why do you think this would not give you an error ???

Hint: You didn't allocate any memory to 'try1'.


Roger Stringer
Marietta Systems, Inc. (www.rf-tp.com)


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

Reply via email to