What you suggested makes a lot of sense and I think it should work. It still
doesn't work for me though, am I doing something else wrong as well? Now I
get the following error
"application1.0 just read from memory location 0x10024AA7 causing an address
error. An address error means that the application accessed a 2 0r 4 byte
value at an odd (not even) memory address"
I changed my unpack routine to:
static void UnpackRange(Range* range, const PackedRange *packedRange)
{
const char *s = packedRange->name;
range->name = s;
s += StrLen(s) + 1;
range->startRange = *((Int32*)s);
s = s + 4;
range->endRange = *((Int32*)s);
}
Thank you, I really appreciate your help.
>From: John Leung <[EMAIL PROTECTED]>
>Reply-To: "Palm Developer Forum" <[EMAIL PROTECTED]>
>To: "Palm Developer Forum" <[EMAIL PROTECTED]>
>Subject: Re: problem reading integers
>Date: Tue, 04 Sep 2001 13:05:32 -0700
>
>At 07:32 PM 04/09/2001 +0000, Salma Saad wrote:
>> packedRange->startRange = (Int32)*s;
>
>Your problem is here. In your code, "s" is defined as const char *. So,
>*s will give you a char variable. Your type cast only cast the char
>variable to Int32. What you want is re-cast the pointer type itself:
>
>packedRange->startRange = *((Int32*) s);
>
>Give this a try and see if it works for you.
>
>John Leung
>EMail: [EMAIL PROTECTED]
>Web: http://persweb.direct.ca/jleung/
>
>
>--
>For information on using the Palm Developer Forums, or to unsubscribe,
>please see http://www.palmos.com/dev/tech/support/forums/
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/