170 Chapter 3
Programming Examples
Using C Programming Over Socket LAN (Windows NT)
}
scan = argv[optind]+1;
optind++;
}
c = *scan++;
posn = strchr(optstring, c); /* DDP */
if (posn == NULL || c == ’:’) {
fprintf(stderr, "%s: unknown option -%c\n", argv[0], c);
return(’?’);
}
posn++;
if (*posn == ’:’) {
if (*scan != ’\0’) {
optarg = scan;
scan = NULL;
} else {
optarg = argv[optind];
optind++;
}
}
return(c);
}