I found this example on a site, loaded in VS and it just gives a blank black screen but sample says it has output. I was looking for something to explain what args is. Can someone explain what args is.
Output is supposed to be:
foreach: Arg1
foreach: Arg2
foreach: Arg3
for: Arg1
for: Arg2
for: Arg3
using System;
class Program
{
static void Main(string[] args)
{
// The program control flow begins here.
// ... Use a foreach loop.
// ... Then use an equivalent for loop.
foreach (string value in args)
{
Console.WriteLine("foreach: {0}", value);
}
for (int i = 0; i < args.Length; i++)
{
string value = args[i];
Console.WriteLine("for: {0}", value);
}
Console.ReadLine();
}
}
Output is supposed to be:
foreach: Arg1
foreach: Arg2
foreach: Arg3
for: Arg1
for: Arg2
for: Arg3