|
发表于 2020-1-7 12:03:01
|
显示全部楼层
The inet_addr() function converts the Internet host address cp from
numbers-and-dots notation into binary data in network byte order. If
the input is invalid, INADDR_NONE (usually -1) is returned. This is an
obsolete interface to inet_aton(), described immediately above; it is
obsolete because -1 is a valid address (255.255.255.255), and
inet_aton() provides a cleaner way to indicate error return.
The inet_ntoa() function converts the Internet host address in given in
network byte order to a string in standard numbers-and-dots notation.
The string is returned in a statically allocated buffer, which subse‐
quent calls will overwrite.
|
|