gtpc1m40 | Transmission Control Protocol/Internet Protocol |
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);
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.