gtpc1m44Transmission Control Protocol/Internet Protocol

ntohs -- Translate a Short Integer

The ntohs function translates a short integer from network byte order to host byte order.

Format

#include  <types.h>
#include  <socket.h>
u_short   ntohs(u_short a);

a
Unsigned short integer to be put into host byte order.

Normal Return

Returns the translated short integer.

Error Return

None.

Programming Considerations

None.

Examples

The following example converts the information from network byte order to host byte order.

#include <types.h>
#include <socket.h>

·
·
·
u_short a; u_short n;
·
·
·
ntohs(a);

Related Information