htons()
Description
Convert a u_short from host to network byte order.
#include <winsock.h>
u_short PASCAL FAR htons ( u_short hostshort );
hostshort
A 16-bit number in host byte order.
Remarks
This routine takes a 16-bit number in host byte order and returns a 16-bit
number in network byte order.
Return Value
htons() returns the value in network byte order.
See Also
htonl(), ntohl(),
ntohs()
[Back: htonl()]
[Next: inet_addr()]