Discussion
The maximum combined length of the command-line arguments including the spaces between adjacent arguments is
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.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development