gethostbyaddr 和 gethostbyaddr 的作用是什么

来源:百度知道 编辑:UC知道 时间:2024/06/21 21:49:52
gethostbyaddr 和 gethostbyaddr 的作用是什么

你写出的两个函数名是一样的!

gethostbyaddr()

返回对应于给定地址的主机信息。

#include <winsock.h>

struct hostent FAR *PASCAL FAR gethostbyaddr(const char
FAR * addr, int len, int type);

addr:指向网络字节顺序地址的指针。

len: 地址的长度,在PF_INET类型地址中为4。

type:地址类型,应为PF_INET。