int main(int argc, char *argv[])
问题 If I have this: int main(int argc, char *argv[]) In the body, you can sometimes find programs using argv[1] . When do we use argv[1] over argv[0] ? Is it only when we just want to read the second argument in the command line? 回答1: By convention , argv[0] is the current program's name (or path), and argv[1] through argv[argc - 1] are the command-line arguments that the user provides. However, this doesn't have to be true -- programs can OS-specific functions to bypass this requirement, and