����涂��苑��乇������ip没����
 gethostname(name, sizeof(name));
 hp = gethostbyname(name);
 memcpy(&(sin.sin_addr), hp->h_addr, hp->h_length);
 strIP = inet_ntoa(sin.sin_addr);
 printf("%s:%s\n",name,strIP);

����winsock�械�gethostbyname��linux�碌牟�同
������为ip时linux����ip��确
��winsock����null
winsock�懈�gethostbyname一���������也���芊�����确ip����null
��么��:)


�� �� freeworm (freeworm) �拇������到: ��
���虾�connect����没������
��gethostbyname���欠���null

  struct hostent *hp;
  hp = gethostbyname(argv[3]);
  
  if (hp==NULL) {
     printf("Unknown host: %s\n",argv[3]);
    exit(0);
  }


�� �� chenqj (��色����) �拇������到: ��
: WSAStartup��������������


--

�� �薷�:��freeworm �� Oct 11 21:16:24 �薷谋��摹�[FROM:     202.194.3.3]


--

�� ��源:��BBS 水木�华站 smth.org��[FROM: 202.194.3.3]