The Windows Sockets ntohs function converts a u_short from TCP/IP network byte order to host byte order (which is big-endian).
u_short ntohs (
u_short netshort
);
The ntohs function takes a 16-bit number in TCP/IP network byte order and returns a 16-bit number in host byte order.
The ntohs function returns the value in host byte order. If the netshort parameter was already in host byte order, then no operation is performed.
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.
htonl, htons, ntohl, WSAHtonl, WSAHtons, WSANtohl, WSANtohs