htonl

This function converts a u_long from host byte order to network byte order.

At a Glance

Header file: Winsock.h
Windows CE versions: 1.0 and later

Syntax

u_long htonl (u_long hostlong);

Parameters

hostlong

[in] 32-bit number in host byte order.

Return Values

The value in TCP/IP’s network byte order indicates success.

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.

See Also

htons, ntohl, ntohs