#include "main.h" //====================================================================== void showIpAddress(const char *hostName) { struct hostent *host=gethostbyname(hostName); if(host) { struct in_addr ipAddress=*((struct in_addr *)(host->h_addr)); printf("`%s' --> %s\n",hostName,inet_ntoa(ipAddress)); } else { printf("unknown host `%s'\n",hostName); } } //====================================================================== // MAIN //====================================================================== int main(int argc, char **argv) { char hostName[0x100]; gethostname(hostName,0x100); showIpAddress(hostName); for(int i=1;i