/* A Script to do the Calculations * by CSS */ #include #include #include int main(int argc, char *argv[]) { if (argc != 2) { (void) fprintf(stderr, "Usage: %s address\n", argv[0]); exit(-1); } { char *cptr = strtok(argv[1], "."); int shift = 24; unsigned long acc = 0L; while (cptr != NULL) { acc += atol(cptr) << shift; shift -= 8; cptr = strtok(NULL, "."); } (void) printf("%lu\n", acc); } return (0); }