htond function (winsock2.h)

The htond inline function converts a double from host to TCP/IP network byte order (which is big-endian).

Syntax

unsigned __int64 htond(
  double Value
);

Parameters

Value

A double that contains a number in host byte order.

Return value

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

Remarks

The htond inline function takes a double that contains number in host byte order and returns a 64-bit unsigned number in the network byte order used in TCP/IP networks (the AF_INET or AF_INET6 address family).

The htond inline function can be used to convert an IPv4 address in host byte order to the IPv4 address in network byte order. This function does not do any checking to determine if the value parameter is a valid IPv4 address.

The htond inline function does not require that the Winsock DLL has previously been loaded with a successful call to the WSAStartup function.

Windows Phone 8: This function is supported for Windows Phone Store apps on Windows Phone 8 and later.

Windows 8.1 and Windows Server 2012 R2: This function is supported for Windows Store apps on Windows 8.1, Windows Server 2012 R2, and later.

Requirements

Requirement Value
Minimum supported client Windows 8.1, Windows 8 [desktop apps | UWP apps]
Minimum supported server Windows Server 2012 [desktop apps | UWP apps]
Target Platform Windows
Header winsock2.h

See also

InetNtop

InetPton

WSAHtonl

WSAHtons

WSANtohl

WSANtohs

htond

htonf

htonll

htons

inet_addr

inet_ntoa

ntohd

ntohf

ntohl

ntohll

ntohs