社区
通信技术
帖子详情
求救inet_pton( )的问题
cocoavic
2007-09-09 12:21:09
我是用VC60写的代码,编译时总显示inet_pton( )未定义,我已加了#include "tpipv6.h"头文件,但还是不行,求救!!!
...全文
1243
6
打赏
收藏
求救inet_pton( )的问题
我是用VC60写的代码,编译时总显示inet_pton( )未定义,我已加了#include "tpipv6.h"头文件,但还是不行,求救!!!
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
6 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
huxiao2005
2008-06-19
打赏
举报
回复
[Quote=引用 2 楼 scorpio16 的回复:]
或者用inet_aton
[/Quote]
汗,windows 有 inet_aton这个函数吗?!
用inet_addr, 或者自己编写一个相同功能的函数
meiZiNick
2008-05-01
打赏
举报
回复
有点难度哦
q1560
2008-01-29
打赏
举报
回复
上面的代码见《Unix网络编程卷一》P61~62
q1560
2008-01-29
打赏
举报
回复
inet_pton()是Unix,Linux中的函数
在linux中 man inet_pton()可看到该函数的说明
若系统没提供该函数,可自己定义:
scorpio16
2008-01-22
打赏
举报
回复
或者用inet_aton
koffdsa
2008-01-17
打赏
举报
回复
Windows没有inet_pton
用WSAStringToAddress可以代替
inet
_
pton
()和
inet
_ntop()功能及使用方法
inet
_
pton
()和
inet
_ntop()功能及使用方法 这两个函数是随IPv6出现的函数,对于IPv4地址和IPv6地址都适用,函数中p和n分别代表表达(presentation)和数值(numeric)[^1]。
inet
_
pton
() 功能: 将标准文本表示形式的IPv4或IPv6 Internet网络地址转换为数字二进制形式。 参数: INT WSAAPI
inet
_
pton
( INT Family, //地址家族 IPV4使用AF_
INET
IPV6使用AF_
INET
6 P
inet
_
pton
和
inet
_ntop函数
inet
_
pton
和
inet
_ntop函数 文章目录
inet
_
pton
和
inet
_ntop函数
inet
_
pton
inet
_ntop例子参考
inet
_
pton
和
inet
_ntop是两个新函数,它用来代替
inet
_aton、
inet
_addr和
inet
_ntoa函数。
inet
_
pton
和
inet
_ntop适用于IPv4和IPv6地址。
inet
_
pton
#include <arpa/
inet
.h> int
inet
_
pton
(int af, const char *src, void *dst
inet
_aton、
inet
_ntoa、
inet
_
pton
和
inet
_ntop
inet
_aton、
inet
_ntoa、
inet
_
pton
和
inet
_ntop都是用于IP地址与大端网络字节序二进制数字相互转换的函数 不同的是
inet
_aton和
inet
_ntoa只支持ipv4类型的地址转换,而
inet
_
pton
和
inet
_ntop支持ipv4和ipv6类型的地址转换
inet
_aton 头文件和函数原型 #include<sys/scoket.h> #include<net
inet
/in.h> #include<arpa/
inet
.h> int i
IP地址转换函数
inet
_
pton
、
inet
_ntop与
inet
_aton、
inet
_addr、
inet
_ntoa
inet
_
pton
NAME
inet
_
pton
- 将 IPv4 和 IPv6 地址从点分十进制转换为二进制 SYNOPSIS #include <arpa/
inet
.h> int
inet
_
pton
(int af, const char *src, void *dst); DESCRIPTION 该函数将字符串src转换为af地址类型协议簇的网络地址,并存储到dst中。对于af参数,必须为AF_
INET
或AF_
INET
6 RETURN VALUE i...
linux内核中使用
inet
_ntop,linux网络编程之
inet
_
pton
和
inet
_ntop函数
Linux下这2个IP地址转换函数,可以在将IP地址在“点分十进制”和“整数”之间转换而且,
inet
_
pton
和
inet
_ntop这2个函数能够处理ipv4和ipv6。算是比较新的函数了。1、
inet
_
pton
函数原型如下[将“点分十进制” -> “整数”]#include #include #include int
inet
_
pton
(int af, const char *src, vo...
通信技术
4,356
社区成员
28,926
社区内容
发帖
与我相关
我的任务
通信技术
通信技术相关讨论
复制链接
扫一扫
分享
社区描述
通信技术相关讨论
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章