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

Discussion

What are command line arguments?

  • A.Arguments passed to main() function
  • B.Arguments passed to any function
  • C.Arguments passed to class functions
  • D.Arguments passed to structure functions

Answer: A

Correct answer: Arguments passed to main() function

Command-line arguments are the strings typed after the program name, which the runtime hands to main as argc and argv.

They reach main and no other function: the parameters are local to it, so any other function needing them must be passed them explicitly or read them from globals the program sets up. C has neither classes nor member functions on structures, so the last two options describe constructs the language does not have.

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

Post your comment

Please log in or register to post a comment.