I'm trying to compile beej's guide to network programming examples, but Windows XP doesn't have such a function. I'm using mingw, if it makes any difference.
+1
A:
If you're only dealing with IPv4 addresses, you can use inet_ntoa
. It's available on Windows 2000 or later. Otherwise you'll have to either require Vista and later, or write your own inet_ntop function.
You could also look at boost - the boost::asio has an inet_ntop
implementation that works in Windows: boost::asio::detail::socket_ops::inet_ntop
. You can see the source code here.
Eclipse
2009-10-13 18:43:40
inet_ntoa is available on every version of windows with WinSock2 on it, you can't trust MSDN when it comes to minimum version, they seem to have forgotten about Win9x and NT4
Anders
2009-10-15 14:42:12
A:
From the winsock layer: WSAAddressToString (ntop) and WSAStringToAddress (pton)
hackworks
2009-10-14 08:03:42