ChinaUnix.net
相关文章推荐:

getLastKnownLocation 返回null

char * host_name="220.181.38.82";///百度音乐盒网址http://220.181.38.82 struct in_addr addr; if(inet_pton(AF_INET,host_name,(void*)&addr)==-1) { perror("phost"); exit(1); } if((host = gethostbyaddr((char *)&addr, 4, AF_INET))==null) { perror("gethostbyaddr"); exit(1); } 失败。为什么啊? 即是解析主机IP地址都是失败的。 说明一下,我在虚拟机下的linux系统下做的。

by greatho1507 - Linux环境编程 - 2008-07-17 12:22:13 阅读(4210) 回复(2)

相关讨论

char * host_name="220.181.38.82";///百度音乐盒网址http://220.181.38.82 struct in_addr addr; if(inet_pton(AF_INET,host_name,(void*)&addr)==-1) { perror("phost"); exit(1); } if((host = gethostbyaddr((char *)&addr, 4, AF_INET))==null) { perror("gethostbyaddr"); exit(1); } 失败。为什么啊? 即是解析主机IP地址都是失败的。 说明一下,我在虚拟机下的linux系统下做的。

by greatho1507 - C/C++ - 2008-07-17 13:14:06 阅读(7544) 回复(16)

[code] main(int argc,char *argv[]) { struct hostent *hent; unsigned long lng=inet_addr(argv[1]); hent=gethostbyaddr((const char *)&lng,sizeof(unsigned long),AF_INET); printf("%s\n",hent->;h_name); } [/code] 测试本机 网关 以及局域网内没开防火墙的虚拟机都失败 是为什么?

by hawfeng - C/C++ - 2005-06-25 23:22:08 阅读(2703) 回复(2)

服务器接受多个连接,然后对每一个连接建一个到mysql的连接做查询,但是有时候mysql_init会返回null,为什么?

by 我learnc - C/C++ - 2009-02-27 11:00:42 阅读(3345) 回复(6)

代码如: [code] void f(PTRType ptr) { //...对ptr进行一些操作 fprintf(stderr, "ptr is %s", (ptr == null) ? "null" : "not null"); return ; } int main() { PTRType ptr = null; ptr = MakeDoc("Hello"); fprintf(stderr, "ptr is %s", (ptr == null) ? "null" : "not null"); f(ptr); fprintf(stderr, "ptr is %s", (ptr == null) ? "null" : "not null"); } [/code] ...

by THEBEST - C/C++ - 2006-07-26 22:04:50 阅读(2356) 回复(15)

nl_sk = netlink_kernel_create(&init_net, NETLINK_TEST, 0, nl_data_ready, null, THIS_MODULE); nl_ck 总是为null。 个人目前认为应该是跟挂载点有关系 此挂载点是网桥下的挂载点,创建socket可以成功 static struct nf_hook_ops http_hooks = { .pf = PF_BRIDGE, //IPV4 协议 的 .priority = NF_BR_PRI_NAT_SRC + 1 , // NF_IP_PRI_FIRST, //NF_IP_PRI_LAST ;NF_IP_PRI_NAT_SRC ; .hooknum = NF_BR...

by Fart_King - 内核源码 - 2014-08-25 13:50:27 阅读(841) 回复(0)

本帖最后由 markieff 于 2014-03-25 18:09 编辑 程序:用gethostbyaddr获取目的IP信息的程序。 程序在编译上没有问题,之前写过一个gethostbyname的程序,可以正常运行,但这个就不行。输入任何IP地址输出的都是:gethostbyaddr error for addr:加上IP,等于返回值是null,希望有大神帮忙看看为什么,困扰好久了,谢谢啦~ 上程序: #include #include #include int main(int argc, char ...

by markieff - C/C++ - 2014-03-29 18:48:06 阅读(2918) 回复(7)

我在网上查gets这个方法,说出现异常或遇到EOF的时候会返回null,有两点不太理解: 1.什么情况会出现这种异常啊? 2.EOF不都是文件结尾标志么,会用gets方法去读取一个文件么?

by shinwu_chen - C/C++ - 2013-09-29 13:14:15 阅读(2807) 回复(4)

如题~~用 malloc 分配内存返回给指针的是null。运行的程序需要分配很多的内存,不能准确得知程序分配的内存大小,但不需要的被free 为什么会返回null值?要怎么处理呀,或者有没有相关资料让我参详一下呀?PS:我用的code::blocks 菜鸟一枚~~请大家多指教啊~~~

by 牛虻杏子 - C/C++ - 2013-01-07 22:00:26 阅读(6463) 回复(43)

用的是网上找到的源码[code]/*************************************************** * file: testpcap1.c * Date: Thu Mar 08 17:14:36 MST 2001 * Author: Martin Casado * Location: LAX Airport (woof!) * * Simple single packet capture program *****************************************************/ #include #include #include #include #include ...

by gouven - C/C++ - 2010-06-18 22:37:10 阅读(4630) 回复(1)

为什么有时打不开目录?

by boldeagle - Linux环境编程 - 2010-01-06 17:15:57 阅读(1679) 回复(1)