GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Placement Papers  >  Oracle  >  Aptitude
Go To First  |  Previous Question  |  Next Question 
 Aptitude  |  Question 19 of 40    Print  
What is the maximum no. of arguments that can be given in a command line in C?


  
Total Answers and Comments: 3 Last Update: November 20, 2006   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
July 03, 2005 13:08:36   
varun        

RE: What is the maximum no. of arguments that can be given in a command line in C?
for a program
int main(int argc char **argv) ....
&&
sizeof(int) number of arguments are possible
hence 32767 args are possible for a 32 bit computer

 
Is this answer useful? Yes | No
June 30, 2006 15:07:49   
Partha006 Member Since: June 2006   Contribution: 6    

RE: What is the maximum no. of arguments that can be g...
wowowow nice calculation and great answer.. hatsoff
 
Is this answer useful? Yes | No
November 19, 2006 23:23:51   
Ashish Agrawal        

RE: What is the maximum no. of arguments that can be g...
NEVER!If you are deciding the numbers of arguments on the basis of size of int in 32 bit compiler it should be 2^31-1. that is almost square of 32767.And The memory allocated to argv is from RAM. SO do you really think compiler allocates memory holding 2^31-1 strings of any size!
 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2010 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape