由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - 给出HOST NAME,要求返回IP ADDRESS的函数?
相关主题
why I cannot get host IP addressHow to sort email address?
multiple network interfacea question about renaming.
请帮忙看看这个问题REMOTE_USER is UNKNOWN??
Re: What's the function to get the local ipHELP gethostbyaddr()
Re: [转载] how to find IP of current server of UNIX by C language(NULLhelp: gethostbyaddr()
what else I can do beside gethostbynamea question about inetd server programming
Which library include gethostbyname?What's the command to see your machine's ip addr?
how to change an ip address for a host?Re: how to close port/socket from parent process?help!!!!!!!!!
相关话题的讨论汇总
话题: address话题: name话题: host话题: ip话题: char
进入Unix版参与讨论
1 (共1页)
j***y
发帖数: 2074
1
UNIX下有没有这样的系统函数?
急问,谢谢!
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
1 (共1页)
进入Unix版参与讨论
相关主题
Re: how to close port/socket from parent process?help!!!!!!!!!Re: [转载] how to find IP of current server of UNIX by C language(NULL
从一个telnet终端最多能启动几个程序在unix上运行?what else I can do beside gethostbyname
talk about data access problemWhich library include gethostbyname?
how to write robort in perl w/out expect?how to change an ip address for a host?
why I cannot get host IP addressHow to sort email address?
multiple network interfacea question about renaming.
请帮忙看看这个问题REMOTE_USER is UNKNOWN??
Re: What's the function to get the local ipHELP gethostbyaddr()
相关话题的讨论汇总
话题: address话题: name话题: host话题: ip话题: char