Go to the first, previous, next, last section, table of contents.


ntohs

Syntax

#include <netinet/in.h>

unsigned short ntohs(unsigned short val);

Description

This function converts from network formatted shorts to host formatted shorts. For the i386 and higher processors, this means that the bytes are swapped from 12 order to 21 order.

Return Value

The host-order value.

Portability

ANSI, POSIX

Example

port = ntohs(tcp.port);


Go to the first, previous, next, last section, table of contents.