以下代码段,运行时返回:error,不知道错在哪里。—————————————————————————
struct hostent *h;
h=gethostbyname("www.sohu.com");
if (h==NULL){
printf("error");
return 1;
};
—————————————————————————
struct hostent *h;
h=gethostbyname("www.sohu.com");
if (h==NULL){
printf("error");
return 1;
};
—————————————————————————
必须先调用WSAStartup函数