windows相当于inet_aton [英] windows equivalent of inet_aton
问题描述
我将一些为linux系统编写的代码转换为windows系统。我使用C ++作为我的Windows系统,并想知道相当于函数inet_aton。
I'm converting some code written for a linux system to a windows system. I'm using C++ for my windows system and wanted to know the equivalent of the function inet_aton.
推荐答案
Windows支持< =http://msdn.microsoft.com/en-us/library/cc805844%28VS.85%29.aspx> inet_pton
类似于 inet_aton
的接口(但是也适用于IPV6地址)。只需提供 AF_INET
作为第一个参数,否则它将以 inet_aton
的方式工作。
Windows supports inet_pton
, which has a similar interface to inet_aton
(but that works with IPV6 addresses too). Just supply AF_INET
as the first parameter, and it will otherwise work like inet_aton
.
(如果你可以更改Linux源码, inet_pton
也可以在那里工作)。
(If you can change the Linux source, inet_pton
will also work there).
这篇关于windows相当于inet_aton的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!