> void > usage(const char *proggie) > { > errx(EXIT_FAILURE, "Usage: %s <ip address>", proggie); > } > > int > main(int argc, char **argv) > { > struct in_addr addr; > > if (argc != 2 || !inet_aton(argv[1], &addr)) { > usage(argv[0]); > } > > (void)printf("%s\n", inet_ntoa(addr)); > return 0; > }
1. Take an internet host address in dotted decimal form, if it is valid convert it to an internal representation. 1b. If it isn't, or no address was supplied print usage information and exit. 2. Convert the internal representation back to dotted decimal form and print it. -- mvh Björn -- http://mail.python.org/mailman/listinfo/python-list