必须use winsock;
gethostbyaddr 根据IP地址返回主机信息
struct HOSTENT FAR * gethostbyaddr (
const char FAR * addr,
int len,
int type
);
addr [in] A pointer to an address in network byte order.
len [in] The length of the address.
type [in] The type of the address.
gethostbyname 根据主机名返回主机信息
struct hostent FAR * gethostbyname ( const char FAR * name );
hostent 主机信息类型说明
struct hostent {
char FAR * h_name;
char FAR * FAR * h_aliases;
short h_addrtype;
short h_length;
char FAR * FAR * h_addr_list;
};
h_name 主机名
h_aliases 别名(数组)
h_addrtype 地址类型
h_length 地址长度
h_addr_list 地址列表
怎么样,够详细的吧.