int main (int argc, char * argv[]) { int i, length; char *ptr; for (i = 0; i < argc; i++) { ptr = argv[i]; length = 0; while (*ptr != 0) { length++; ptr++; } printf("Length of '%s', argv[%d] = %d\n", argv[i], i, length); } return(0); }