Why is the command line arguments count variable (traditionally argc
) an int
instead of an unsigned int
? Is there a technical reason for t
The fact that the original C language was such that by default any variable or argument was defined as type int, is probably another factor. In other words you could have:
main(argc, char* argv[]); /* see remark below... */
rather than
int main(int argc, char *argv[]);
Edit: effectively, as Aaron reminded us, the very original syntax would have been something like
main(argc, argv) char **argv {... }
Since the "prototypes" were only introduced later. That came roughly after everyone had logged a minimum of at least 10 hours chasing subtle (and not so subtle) type-related bugs