I am just getting started with some basic C# Exercise. I am referring the examples from the below link
https://msdn.microsoft.com/en-us/library/aa288457(v=vs.71).aspx
Here is the code below
// cmdline2.cs
// arguments: John Paul Mary
using System;
public class CommandLine2
{
public static void Main(string[] args)
{
Console.WriteLine("Number of command line parameters = {0}",
args.Length);
Console.ReadLine();
foreach (string s in args)
{
Console.WriteLine(s);
}
}
}
Below is the expected outcome.
Run the program using some arguments like this: cmdline2 John Paul Mary.
The output will be:
Number of command line parameters = 3
John
Paul
Mary
However in my case first when I tried to execute the code, the command line is appearing for a second and getting disappeared.
I added console.read() and I am seeing below.
Number of command line parameters = 0
So I wanted to understand what's going wrong out here. Any help is appreciated.
Regards Anurag