www.delorie.com/djgpp/doc/libc-2.01/libc_395.html   search  
Go to the first, previous, next, last section, table of contents.


htons

Syntax

#include <netinet/in.h>

unsigned short htons(unsigned short val);

Description

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

Return Value

The network-order value.

Example

tcp.port = htons(port);


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

  prev next   webmaster     delorie software   privacy  
  Copyright © 1997     Updated Apr 1997