摘要:
使用这个东西,首先要包含2个头文件:#include <netdb.h>#include <sys/socket.h>struct hostent *gethostbyname(const char *name);这个函数的传入值是域名或者主机名,例如" www.google.com.tw","wpc "等等。传出值,是一个hostent的结构(如下)。如果函数调用失败,将返回NULL。struct hostent {
char *h_name;
char **h_aliases;
int h_addrtype;
int h_le 阅读全文
posted @ 2012-01-30 19:21
yming0221
阅读(1442)
评论(0)
推荐(0)

浙公网安备 33010602011771号