Du kan "oversætte" ip-adresse med:
#include <windows.h>
#include <string>
#include <iostream>
#include <winsock2.h>
std::string GetHostName(unsigned int aNr)
{
HOSTENT* Hostent = gethostbyaddr((const char*)&aNr, 4, AF_INET);
if(!Hostent)
return "NULL";
return Hostent->h_name;
}
int main()
{
WSADATA wsaData;
WSAStartup(MAKEWORD(2,2),&wsaData);
unsigned int Addr = inet_addr("195.137.194.128");
std::cout << std::hex << Addr << std::endl;
std::cout << GetHostName(Addr) << std::endl;
}
195.137.194.128 er dr.dk, det skulle programmet gerne skrive når du kører det.