Converts an Internet address into an ASCII string.
Standard C Library (libc.a)
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
char *inet_ntoa ( InternetAddr)
struct in_addr InternetAddr;
The inet_ntoa subroutine takes an Internet address and returns an ASCII string representing the Internet address in dot notation. All Internet addresses are returned in network order, with the first byte being the high-order byte.
Use C language integers when specifying each part of a dot notation.
All applications containing the inet_ntoa subroutine must be compiled with the _BSD macro set to a specific value. Acceptable values are 43 and 44. In addition, all socket applications must include the BSD libbsd.a library.
Item | Description |
---|---|
InternetAddr | Contains the Internet address to be converted to ASCII. |
Upon successful completion, the inet_ntoa subroutine returns an Internet address.
If the inet_ntoa subroutine is unsuccessful, the subroutine returns a -1.
Item | Description |
---|---|
/etc/hosts | Contains host names. |
/etc/networks | Contains network names. |