1.

In linux, argv[0] by command-line argument can be occupied by _________(a) ./a.out(b) ./test(c) ./fun.out.out(d) all of the mentionedI have been asked this question in quiz.The origin of the question is Command Line Arguments in section Pointers and Arrays in C of C

Answer»

Correct answer is (d) all of the MENTIONED

Easy explanation - All the options mentioned (./a.out, ./test, ./fun.out.out) are simply the command WITHOUT any argument. A command is ALWAYS stored as argument vector zero i.e., argv[0] always contain the command where as argv[1], argv[2], etc. CONTAINS the arguments to the commands, if any.



Discussion

No Comment Found

Related InterviewSolutions