What are commandline arguements. Plz explain me in detail

Showing Answers 1 - 6 of 6 Answers

T.Raghavendra

  • Nov 24th, 2006
 

command line aruments are nothing but passing the function arguments through command line. ex: $ program name argument1 argument2 main(int argc, char *argv[]) argc is the number of arguments passed here is 3 including program name. argv is array of character pointers i.e array of strings hence argv[0] is program name argv[1] is argument1 argv[2] is argument2Thanks

  Was this answer useful?  Yes

Arguments mean passing the values from calling function to the functiondefinition(called function).Those are user defind functions.
If we want pass the arguments to main() funtion there only one way which is command line arguments. i.e we pass the arguments to the main()function from stadard I/P device.Declaration for commandline arguments is as fallows.

main(int argc,char *argv[])

here argc is noof arguments we passed through commandline.
and *argv[] pointer array of our arguments(Our arguments).

ThankU
Ashok

  Was this answer useful?  Yes

Give your answer:

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

 

Related Answered Questions

 

Related Open Questions