Porting 16 bit to 32 bit

tommym121
tommym121 used Ask the Experts™
on
I have past down the address of a structure to a function. As I debug it within the function, I see values are proper assigned to the member of the structure. However upon the return of the function. the value of the member seems to be incorrectly assigned.

for example, in the structure, there are this two element
int id = 0x6839
char node = 0x1C

when they are being assigned in the members of the structure.
However the value shift within same address structure after the function call
int id = 0x00
char node = 0x1C839
Does anyone know what to do to correct this problem?C

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
ozo
Most Valuable Expert 2014
Top Expert 2015
Commented:
can you show the function and the call?
are you sure the address is valid?
Is your int 16-bits on one machine and 32 bits on the new 32-bit machine?

> char node = 0x1C839
How is it that you are showing that node (1 byte) is more than 8 bits?

Author

Commented:
find out my code is wrong. Thanks guy for your help

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial