It will look like int main(int argc, char *argv[]);. My questions are:
1 How many array items can I add in argv[]?
2 What is MAX size of every char *?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can try:
http://pubs.opengroup.org/onlinepubs/007904975/basedefs/limits.h.html
That is, there is no individual limit on the number of arguments or argument’s length. Only the limit on total size required to store all the arguments and environment variables.
xargsfigures out maximum command line length usingsysconf(_SC_ARG_MAX);which yields the same value as reported bygetconf ARG_MAX.On Linux command line arguments and environment variables are put into new process’ stack. So, the process/thread maximum stack size is the ultimate upper bound. Linux-specific limits are hardcoded in the kernel: