Machine-translated by Google. Questions are authored in English.
Top

Discussion

The first argument to be supplied at command-line must always be count of total arguments.

  • A.True
  • B.False

Answer: B

Correct answer: False

Nothing of the kind is supplied by the user. The shell counts the arguments itself and passes that count to the program in argc, so the count travels alongside the arguments rather than among them.

Everything the user types after the program name is an ordinary argument, available from argv[1] onwards. Requiring the user to state a count would be redundant and error-prone, and no convention on any common system does so.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.