c ip2long
来源:互联网 发布:淘宝店怎么玩 编辑:程序博客网 时间:2024/06/07 16:34
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdio.h>
int main(){
struct in_addr addr;
const char * const straddr = "192.168.0.1";
int ret = inet_aton(straddr,&addr);
printf("%s : %lu\n",straddr,addr.s_addr);
printf("ret: %d\n",ret);
return 0;
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdio.h>
int main(){
struct in_addr addr;
const char * const straddr = "192.168.0.1";
int ret = inet_aton(straddr,&addr);
printf("%s : %lu\n",straddr,addr.s_addr);
printf("ret: %d\n",ret);
return 0;
}
输出结果:
[guichenglin@dir]$ ./a.out
192.168.0.1 : 16820416
ret: 1
- c ip2long
- ip2long & long2ip
- ip2long long2ip
- C语言下的ip与long之间的互换(long2ip,ip2long)
- PHP ip2long 算法实现
- ip2long和long2ip
- php ip2long的bug
- php 库函数ip2long实现
- php---long2ip()与ip2long()
- PHP:IP转换整形(ip2long)
- PHP:IP转换整形(ip2long)
- php IP转换整形(ip2long)
- php IP转换整形(ip2long)
- php IP转换整形(ip2long)
- php函数long2ip与ip2long()
- PHP代码ip2long 循环问题
- PHP使用ip2long返回负数
- 高效修复ip2long函数的BUG
- VS2010编译时 mt.exe出错解决方法
- eclipse 的一些使用心得
- Insert 'value' into every element but the first
- helloworld对应的汇编
- php---window 7 配置memcached并测试成功
- c ip2long
- 如何做好软件系统的架构设计?
- Delphi 读写XML文件方式
- HTML and URL Parser
- String和StringBuffer的区别
- linux sed 批量替换字符串
- SQL Server 2008 R2 数据库之间的数据同步热备份
- Visual Studio安装卸载模板
- SqlPlus Set常用设置