#include #include /* Don't forget to add the ws2_32.a library! * @author: AresXP */ int main(int argc, char *argv[]) { using namespace std; WSAData wData; if (WSAStartup(MAKEWORD(2,2), &wData) == SOCKET_ERROR) { cout << "Winsock init error\n"; return 1; } hostent *h = NULL; h = gethostbyname(argv[1]); if (h == NULL) { cout << "Could not resolve" << endl; return 1; } cout << inet_ntoa(*(reinterpret_cast(h->h_addr))) << endl; return 0; }