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


htonl

Syntax

#include <netinet/in.h>

unsigned long htonl(unsigned long val);

Description

This function converts from host formatted longs to network formatted longs. For the i386 and higher processors, this means that the bytes are swapped from 1234 order to 4321 order.

Return Value

The network-order value.

Example

packet.ipaddr = htonl(ip);


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

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