What is the second argument in command line arguments?
Answer: B
Correct answer: A pointer to an array of character strings that contain the arguments, one per string
The second parameter is argv. Declared char *argv[] it is an array of pointers, and as a parameter it decays to a pointer to its first element, which is how char **argv comes to be an equivalent declaration.
Each element addresses one null-terminated argument, with argv[0] naming the program and argv[argc] guaranteed null. The first parameter, argc, carries the count of those strings.
Please log in or register to report this question.