htonl

The Windows Sockets 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] A 32-bit number in host 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.

Return Values

The htonl function returns the value in TCP/IP's network byte order.

QuickInfo

  Windows NT: Yes
  Windows: Yes
  Windows CE: Use version 1.0 and later.
  Header: Declared in winsock2.h.
  Import Library: Link with ws2_32.lib.

See Also

htons, ntohl, ntohs, WSAHtonl, WSAHtons, WSANtohl, WSANtohs