inet_ntop() extends the inet_ntoa(3) function to support
multiple address families, inet_ntoa(3) is now considered to
be deprecated in favor of inet_ntop().
From “man inet_pton”:
Unlike inet_aton(3) and inet_addr(3), inet_pton() supports
IPv6 addresses. On the other hand, inet_pton() accepts only
IPv4 addresses in dotted-decimal notation, whereas
inet_aton(3) and inet_addr(3) allow the more general
numbers-and-dots notation (hexadecimal and octal number
formats, and formats that don't require all four bytes to be
explicitly written). For an interface that handles both
IPv6 addresses, and IPv4 addresses in numbers-and-dots
notation, see getaddrinfo(3).
From “man inet_ntop”:
From “man inet_pton”: