由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - why I cannot get host IP address
相关主题
给出HOST NAME,要求返回IP ADDRESS的函数?HELP gethostbyaddr()
what else I can do beside gethostbynamehelp: gethostbyaddr()
? on network traffica question about inetd server programming
Re: What's the function to get the local ipWhat's the command to see your machine's ip addr?
Re: [转载] how to find IP of current server of UNIX by C language(NULLRe: how to close port/socket from parent process?help!!!!!!!!!
Which library include gethostbyname?从一个telnet终端最多能启动几个程序在unix上运行?
how to change an ip address for a host?[转载] how to get process state in C/C++
REMOTE_USER is UNKNOWN??[转载] How to Packet Capture in Linux
相关话题的讨论汇总
话题: ip话题: addr话题: address话题: get话题: j4
进入Unix版参与讨论
1 (共1页)
l***r
发帖数: 459
1
Greetings,
I wrote the following code and wish I could get IP address
like 64.58.76.176.
But it give me like this" J5J3@:L藏 J4@:L矦:L柏 J
J7@:L".
What's wrong? Thanks.
I use "g++ -o try -lsocket -lnsl try.cpp " to compile it.
struct hostent *h;
char addr[] = "www.yahoo.com";
h = gethostbyname(addr);
cout << h->h_addr << endl;
1 (共1页)
进入Unix版参与讨论
相关主题
[转载] How to Packet Capture in LinuxRe: [转载] how to find IP of current server of UNIX by C language(NULL
[转载] ? on put/get fileWhich library include gethostbyname?
how can I change csh to tcsh or bashhow to change an ip address for a host?
want to confirm ? on linked fileREMOTE_USER is UNKNOWN??
给出HOST NAME,要求返回IP ADDRESS的函数?HELP gethostbyaddr()
what else I can do beside gethostbynamehelp: gethostbyaddr()
? on network traffica question about inetd server programming
Re: What's the function to get the local ipWhat's the command to see your machine's ip addr?
相关话题的讨论汇总
话题: ip话题: addr话题: address话题: get话题: j4