Wow, that was blatantly obvious. Thanks!

I wrongly assumed that an int was 8 bit signed so a UInt was an 8 bit
unsigned.  UInt was set for UInt16.  Changed the UInt's in the code to
UInt8's and it works perfectly!  Thanks!!!

-Mike



"Matt Graham" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Mike wrote:
> >
> > char  Item1[4];
> > char  Item2[2];
> > char  Item3[4];
> >
> > char* MyArray[3] ={Item1,Item2,Item3};
> >
> > Main()
> > {
> >     MyFunction(MyArray[1],MyArray[2]);
> > }
> >
> > MyFunction(char* val1, char* val2)
> > {
> >     if(*(UInt*)Val1 != *(UInt*)Val2)
> >     {
> >       do something;
> >     }
> > }
>
> This looks an alignment issue.  Integer access has to be integers that
> are correctly aligned in memory.  If the strings pointed to by MyArray
> are not aligned with the sizeof(UInt) then this would crash you.  What
> size ints are you using?  It looks like it should work using UInt16s,
> but UInt32 would almost certainly wreck this.
>
> -matt
>



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

Reply via email to