>> 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 ?
PL> An integer value (or any other data type bigger than 1 byte) *must* be even
PL> aligned. The compiler inserts padding bytes to ensure this. So if you write:
PL> typedef MyStruct {
PL> int int1;
PL> char text[35];
PL> int int2;
PL> }
PL> The compiler generates:
PL> typedef MyStruct {
PL> int int1;
PL> char text[35];
PL> char padding;
PL> int int2;
PL> }
PL> Pascal
To assure that I don't have this problem, I always put the binary
data first in the record. So they are always even.
Sebas
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/