We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Dear Sir:
I am using lpc 2468 processor and uvision compiler.
I have following c++ structure
struct{ BYTE a; //8bits BYTE b; //8bits WORD c; //16bit }
in the begin, the corresponding memory is 00 00 00 00 after let's say, I assign a = 1, b = 2, I got 01 02 00 00 however, if I assign c some value, let's say, c = 0x0a0b,instead of have
01 02 0a 0b, which is what I want. I got 01 0b 0a 00.
if I change my struct to struct{ BYTE b; //8bits WORD c; //16bit } and do similar assign as above, i will get 0b 0a 00 not 01 0a 0b.
Can you please tell me what is wrong and how to solve the problem?
Thank you!
Z
maybe he's cross-posting...