htonl
The htonl function converts a u_long from host to TCP/IP network byte order (which is big-endian).
u_long htonl( u_long hostlong );
Parameters
-
hostlong
- [in] 32-bit number in host byte order.
Return Values
The htonl function returns the value in TCP/IP's network byte order.
Remarks
The htonl function takes a 32-bit number in host byte order and returns a 32-bit number in the network byte order used in TCP/IP networks.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Winsock2.h.
Library: Use Ws2_32.lib.
ntohl
The ntohl function converts a u_long from TCP/IP network order to host byte order (which is little-endian on Intel processors).
u_long ntohl( u_long netlong );
Parameters
-
netlong
- [in] 32-bit number in TCP/IP network byte order.
Return Values
The ntohl function always returns a value in host byte order. If the netlong parameter was already in host byte order, then no operation is performed.
Remarks
The ntohl function takes a 32-bit number in TCP/IP network byte order and returns a 32-bit number in host byte order.