S
sureshjayaram
I have problem with the code only with 64 bit big endian machine.
i have a member size_t val1 in my structure. The size of size_t is
32(unsigned int) in 32 bit machines and 64(unsigned long) in 64 bit
machines.
I am passing address of this variable to a different function (where it
accepts only pointer to unsigned int) unsigned int *. Basically passing
a unsigned long pointer instead of unsigned int pointer. I think the
value is getting truncated while dereferencing int *. In this case how
do I make my code portable? Can functions like htonl/ntohl will help?
or casting could be of any help?
Thanks,
Suresh
i have a member size_t val1 in my structure. The size of size_t is
32(unsigned int) in 32 bit machines and 64(unsigned long) in 64 bit
machines.
I am passing address of this variable to a different function (where it
accepts only pointer to unsigned int) unsigned int *. Basically passing
a unsigned long pointer instead of unsigned int pointer. I think the
value is getting truncated while dereferencing int *. In this case how
do I make my code portable? Can functions like htonl/ntohl will help?
or casting could be of any help?
Thanks,
Suresh