j***y 发帖数: 2074 | | n******t 发帖数: 4406 | 2 gethostbyname
【在 j***y 的大作中提到】 : UNIX下有没有这样的系统函数? : 急问,谢谢!
| j***y 发帖数: 2074 | 3 any example? thanks.
【在 n******t 的大作中提到】 : gethostbyname
| j***y 发帖数: 2074 | 4 i have written a small program to test it.
but the ip address part doesn't return any result.
any problem with it?
#include
#include /* For gethostbyname() */
/*
struct hostent {
char *h_name; -- official name of host
char **h_aliases; -- alias list
int h_addrtype; -- host address type
int h_length; -- length of address
char **h_addr_list; -- list of addresses from name server
#define h_addr h_addr_list[0] -- address, for backward compatiblity
};
*/
int main(int argc, char **
【在 n******t 的大作中提到】 : gethostbyname
|
|