gtpc1m40Transmission Control Protocol/Internet Protocol

inet_ntoa -- Return Pointer to a String in Dotted Decimal Notation

The inet_ntoa function returns a pointer to a string in dotted decimal notation.

Format

#include  <types.h>
#include  <socket.h>
char *inet_ntoa(struct in_addr in);

in
The host Internet address.

Normal Return

This function returns a pointer to a string expressed in dotted decimal notation. The call accepts an Internet address expressed as a 32-bit quantity in network byte order and returns a string expressed in dotted decimal notation. Storage pointed to exists on an entry control block (ECB) basis and is overwritten by subsequent calls.

Error Return

None.

Programming Considerations

None.

Examples

The following example returns a pointer to the input address in dotted decimal notation.

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

·
·
·
struct in_addr in; char *inetadd; in = 0x975C645; inetadd = inet_ntoa(in); printf("IP address is %s\n",inetadd);

Related Information

inet_addr -- Construct Internet Address from Character String.