No, there is no limit imposed by the ISO C99 standard. If you're using the "blessed" main
form (of which there are two):
int main (int argc, char *argv[]);
then you will be limited to the maximum size of a signed integer (implementation-dependent but guaranteed to be at least 215-1 or 32,767).
Of course, you could even have more than that since the standard specifically allows for non-blessed main
forms (for example, one that takes a long
as the count).
The standard mandates how the arguments are stored and things like argv[argc]
having to be NULL, but it does not directly limit the quantity.
Of course, there will be a limit in practice but this will depend entirely on the implementation and environment. However, if you have to ask, then you're probably doing something wrong.
Most tools would place a truly large number of arguments into a response file (say args.txt
) then pass a single argument like:
my_prog @args.txt
which gets around arbitrary limits on argument quantity and size.