功能
int inet_pton(int af, const char *src, void *dst);
在头文件中声明:
#include <arpa/inet.h>
如果是Windows(Vista或更高版本),则有此ANSI版本的Winsock类似物:
INT WSAAPI InetPton( _In_ INT Family, _In_ PCTSTR pszAddrString, _Out_ PVOID pAddrBuf);
尝试
#include <Ws2tcpip.h>添加Ws2_32.lib



