> I have solved the problem
> I changed the string from 35 to 34 chars in the record data directly
> and use      text = (char*)&intPtr[34];    instead
>
> but I am interested to know the method for the string of 35 chars
> any suggestion ?

An integer value (or any other data type bigger than 1 byte) *must* be even
aligned. The compiler inserts padding bytes to ensure this. So if you write:

typedef MyStruct {
  int  int1;
  char text[35];
  int  int2;
}

The compiler generates:

typedef MyStruct {
  int  int1;
  char text[35];
  char padding;
  int  int2;
}

Pascal




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

Reply via email to