Results 1 to 2 of 2

Thread: Command Line Arguments

  1. #1
    BrooksGray is offline Senior Member
    Join Date
    Dec 2009
    Posts
    231
    Rep Power
    3

    Default Command Line Arguments

    Hi. I am new in programming world. Currently I am learning C programming language, I want to about what is Command Line Arguments? What are its uses? Where we have to use this? If you are having any suggestions then reply me. It can helpful to me.

  2. #2
    CruzPowell is offline Senior Member
    Join Date
    Dec 2009
    Posts
    224
    Rep Power
    3

    Default

    Command line arguments are those which can be passed to the main method as parameters and use those values in the main method before executing it. Try to understand the following example. It is very simple.

    Code:
    #include <stdio.h>
    
    	main( int argc, char *argv[] )  
    	{
    		if( argc == 2 )
    			printf("The argument supplied is %sn", argv[1]);
    		else if( argc > 2 )
    			printf("Too many arguments supplied.n");
    		else
    			printf("One argument expected.n");
    	}

Similar Threads

  1. What are Command-Line Arguments in Java?
    By MorganCooper in forum Programming
    Replies: 2
    Last Post: 02-22-2010, 03:44 PM
  2. Accepting command line arguments
    By Jacory666 in forum Programming
    Replies: 0
    Last Post: 10-17-2009, 09:37 AM
  3. Command line installation
    By Agustin321 in forum General Software Terms
    Replies: 0
    Last Post: 04-17-2009, 06:20 AM
  4. The GRUB command line
    By Macavi6987 in forum Applications
    Replies: 0
    Last Post: 11-22-2008, 12:57 PM
  5. Command line AD searches
    By wonlkad in forum Technologies
    Replies: 0
    Last Post: 06-25-2008, 12:27 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
SEO by SubmitEdge

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48