ntohl: Translate a long integer

The ntohl socket function translates a long integer from network byte order to host byte order.

Last updated

Added for PUT00.

Format

#include  <sys/types.h>
#include  <sys/socket.h>
u_long    ntohl(u_long a);
a
Unsigned long integer to be put into host byte order.

Normal return

Returns the translated long integer.

Error return

None.

Programming considerations

None.

Examples

The following example converts the information from network byte order to host byte order.
#include <sys/types.h>
#include <sys/socket.h>
⋮
u_long a;
u_long n;
⋮
n = ntohl(a);

Related information

See z/TPF Transmission Control Protocol/Internet Protocol for information about z/TPF TCP/IP support.