Export (0) Print
Expand All
Expand Minimize

htonf function

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

Syntax


unsigned __int32 __inline htonf(
  float value
);

Parameters

value

A float that contains a number in host byte order.

Return value

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

Remarks

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

The htonf 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 htonf inline function does not require that the Winsock DLL has previously been loaded with a successful call to the WSAStartup function.

(Windows Store apps): This API is supported.

Requirements

Minimum supported client

Windows 8 [desktop apps only]

Minimum supported server

Windows Server 2012 [desktop apps only]

Header

Winsock2.h

See also

htond
htons
htonll
inet_addr
inet_ntoa
InetNtop
InetPton
ntohd
ntohf
ntohl
ntohll
ntohs
WSAHtonl
WSAHtons
WSANtohl
WSANtohs

 

 

Community Additions

ADD
Show:
© 2014 Microsoft