In linux, argv[0] by command-line argument can be occupied by _________
Answer: D
Correct answer: all of the mentioned
argv[0] holds the name by which the program was invoked, and on Linux that is whatever string the user typed to run it - whether ./a.out, ./test or anything else.
The name has no necessary connection to the source file, and a program can be renamed freely. It is not even guaranteed to be a real filename: a shell or an exec call can supply any string it likes, which is what lets a single binary behave differently under several names, as busybox does.
Please log in or register to report this question.