LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-12-2007, 03:00 AM   #1
i.you
Member
 
Registered: Oct 2006
Posts: 46

Rep: Reputation: 15
Max. number of command line arguments?


Hi there,

In the main(int argc, char **argv), what the max. number of command line arguments is?
In my written program, it's no problem if the number is about 200, but the seg. fault occurs if more than 300.
If the number does not matter, what's wrong ?

Help me please...
 
Old 04-12-2007, 08:40 AM   #2
wjevans_7d1@yahoo.co
Member
 
Registered: Jun 2006
Location: Mariposa
Distribution: Slackware 9.1
Posts: 938

Rep: Reputation: 31
If there is a maximum number of arguments to a program, it's certainly more than 300 or so.

Segmentation faults occur when you attempt to access memory locations that don't exist. This is commonly caused by using an invalid index into an array.

Use the debugger gdb to help track this down. If that presents too steep a learning curve for now, try simplifying the program as much as possible, and see which simplification step causes the problem to go away.

If you end up with a really simple program which still has the problem, post it here and we can take a look at it.

Hope this helps.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
need some help regarding command line arguments kristam269 Linux - General 1 01-23-2007 09:40 AM
command line arguments nickraj Programming 6 09-11-2006 01:01 PM
command line arguments containing ( Lotharster Linux - Newbie 3 01-05-2006 08:43 AM
number of command line arguments to shell u4u Linux - General 1 03-04-2005 06:09 PM
Help with command line arguments ? synapse Linux - Newbie 2 02-23-2004 02:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration