Series: Subject: Topic:
Question: 150 of 828

Maximum combined length of command line arguments in C

What is the maximum length of command line arguments including space between adjacent arguments ?
Asked by: Ajay Kanse | Member Since Jul-2007 | Asked on: Dec 22nd, 2008

View all questions by Ajay Kanse   View all answers by Ajay Kanse

Showing Answers 1 - 4 of 4 Answers

Answered On : Jan 24th, 2009

View all answers by srinivas1

It can compile 200 words of length.

Login to rate this answer.

Answered On : Jul 1st, 2010

View all answers by kbjarnason

Presumably this would be (INT_MAX-1) * SIZE_MAX.  That is, each argument can presumably be up to SIZE_MAX chars, and there can be INT_MAX - 1 arguments (one being needed for argv[0], the program name).Since the actual values of INT_MAX and SIZE_MAX are implementation defined, no maximum can be definitively given ahead of time.That said, one might suspect the hosting OS and/or startup code would provide somewhat more stringent limits.

Login to rate this answer.

Answered On : Jul 6th, 2010

View all answers by jbode

The C language standard does not impose any maximum on command line length/number of command-line arguments (not that I could find after a cursory search, anyway); the command-line shell is usually the limiting factor in this sort of thing. 

Login to rate this answer.

Answered On : Sep 25th, 2011

It may vary from one operating system to another

Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions



twitter fb Linkedin GPlus RSS


Interview Question

 Ask Interview Question?


Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.