Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
C#
public class CommandLine
{
    public static void Main(string[] args)
    {
        Console.WriteLine("Number of command line parameters={0}", args.Length);
        Console.ReadKey();
        for (int i = 0; i < args.Length; i++)
        {
            Console.WriteLine("args[{0}]=[{1}]", i, args[i]);


        }
    }
}


Can any one briefly explain what exactly does the bolded part of the code do???
Posted

It returns every single parameter provided via "args"... Just run the code ;)
 
Share this answer
 
I just hope this is not one of your assignments!

The bold part is taking the arguments one by one and printing that off... in a format like...
args[0] = something
args[1] = something
....

Must be quite clear...once you execute the program... or just debug it!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900