This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

2468

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

0