[Tutor] Problems with unsigned integers

Loptr Chaote loptr.chaote at gmail.com
Mon Dec 13 19:38:28 CET 2004


On Mon, 13 Dec 2004 13:27:25 -0500, Kent Johnson <kent37 at tds.net> wrote:
> It seems that ntohl doesn't understand about unsigned values, at least on Win32:
> 

Wow, I've never actually considered using the interpreter/CLI like
that. Thank you!

I'm writing my own u_ntohl() now which checks to see if the
socket-module ntohl()-function does something with the value, and if
so reorders 0xAABBCCDD to 0xDDCCBBAA and if not it returns same value
as the one sent as argument.

This should be enough, right?

-L.C

PS. Obviously I was wrong regarding ntohl() not being the source of
the error, and I'm not sure any longer how I came to the conclusion
that it wasn't.


More information about the Tutor mailing list