Command line argument
With the first introduction post of C# you can understand the return value of the Main() method, let’s examine the incoming array of string data. Assume that you now want to update your application to process any possible command-line parameters. One way to do so is using a C# for loop. We will see for loop in C# in later article. Accessing command line arguments with for loop Program using System; public class CLA { public static void Main(string[] args) { //this loop prints any number of given command line arguments for(int i=0; i<args.Length; i++) { Console.WriteLine("arg-" + i + " = " + args[i]); } } } Output F:\Code\Algorithm>csc CLA.cs F:\Code\Algorithm>CLA tangled java elaborately arg-0 = tangled arg-1 = java arg-2 = elaborately Explanation Here, you are checking to see whether the array of strings contains some number of items using the Length property of Sys...