C++ 我从哪里得到 arpa/inet.h?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20543940/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Where do I get arpa/inet.h?
提问by Pavel Oganesyan
Question is really simple.
I need a tool to convert char*
to ip adress and use it in
问题其实很简单。我需要一个工具来转换char*
为 ip 地址并在
sockaddr_in.s_addr
arpa/inet.h has inet_addr()
function, but I am not sure if I already have this file somewhere in MS VS 2010 installation or should I get it elsewhere.
arpa/inet.h 有inet_addr()
功能,但我不确定我是否已经在 MS VS 2010 安装的某个地方有这个文件,或者我应该在其他地方得到它。
采纳答案by ComicSansMS
Win32 provides its own implementation of the sockets API (Winsock) which uses slightly different headers.
Win32 提供了自己的套接字 API (Winsock) 实现,它使用稍微不同的标头。
From the MSDN for inet_addr
:
Header Winsock2.h
标题 Winsock2.h