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

Discussion

The maximum combined length of the command-line arguments including the spaces between adjacent arguments is

  • A.128 characters
  • B.256 characters
  • C.67 characters
  • D.It may vary from one operating system to another

Answer: D

Correct answer: It may vary from one operating system to another

The C standard says nothing about how long a command line may be; the limit belongs to the operating system and its shell.

MS-DOS allowed 127 characters, which is where the figures in the distractors come from. Modern systems are far more generous - Linux permits a few hundred kilobytes for the whole argument and environment block, and Windows around 32,000 characters - and the limit differs again between shells. Portable code therefore reads long inputs from a file or from standard input rather than from the command line.

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

Post your comment

Please log in or register to post a comment.