htons

Top  Previous  Next

The htons macro converts unsigned short integer hostshort from host byte order to network byte-order.

 

Syntax

unsigned short htons(

unsigned short hostshort

);

 

Parameters

hostshort

Host byte-order unsigned short to convert.

 

Return value

The htons macro returns a network-ordered unsigned short.