Thread View: cn.bbs.comp.program
1 messages
1 total messages
Started by ������
Tue, 09 Dec 1997 00:00
Re: ��λ�ñ����IP��ַ��(Visual C++)
Author: ������
Date: Tue, 09 Dec 1997 00:00
Date: Tue, 09 Dec 1997 00:00
43 lines
1751 bytes
1751 bytes
struct hostent
{
charFAR *h_name;
charFAR * FAR * h_aliases;
short h_addrtype;
short h_length;
char Far * FAR *h_addr_list;
#define h_addr h_addr_list[0]; // Address, for backward compatibility
};
h_hame : �������ʽ����
h_aliases: �ԡ�NULL����β���滻������
h_addrtype: ���صĵ�ַ���ͣ���Windows Sockets��˵��������AF_INET;
h_length: ÿ����ַ�ij��ȣ����ֽڣ�����AF-INET��˵����ֵ����4
addr_list: �ԡ�NULL����β��һϵ�д�����ĵ�ַ��Windows Sockets �������ֽ�˳����Щ��ַ��
�����µõ���
LPHOSTENT lpHostEnt;
LPSTR szIPAddr;
lpHostEnt = gethostbyname(....);
szIPAddr = inet_ntoa(*(LPIN_ADDR) * (lpHostEnt->h_addr_list));
�� �� quest (����) �Ĵ������ᵽ: ��
: �� �� netguy.bbs@bbs.whnet.edu.cn (������) �Ĵ������ᵽ: ��
: : man hostent
:
: ���æ������һ��hostent�ĸ����δ��л��IP��ַ��
:
--
[1;36m�� ��Դ:����ˮ˼Դվ bbs.sjtu.edu.cn��[FROM: www]
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads