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
Please post the code where you actually do the assignment along with the actual variable definitions. A number of things can go wrong here. Don't forget the 'pre' and '/pre' tags.
Are the instructions really that difficult to see or understand:
www.danlhenry.com/.../keil_code.png
Don't manually re-type the code into the post - use only copy-and-paste;
Note that TABs don't work (well) - use spaces instead,
and don't forget to check it in the 'Preview'...
we is being scared he away me be thinks???
maybe he's cross-posting...