#include /* for fprintf() */ #include /* for gethostbyname() */ #include /* for exit() */ unsigned long ResolveName(char name[]) { struct hostent *host; /* Structure containing host information */ if ((host = gethostbyname(name)) == NULL) { fprintf(stderr, "gethostbyname() failed"); exit(1); } /* Return the binary, network byte ordered address */ return *((unsigned long *) host->h_addr_list[0]); }