Interviews2 answers
In C# static void Main(string[] args){ } is the entry point of application.string[] args is used for command-line arguments.So what is the use of these command-line arguments ?
2 Answers
you can pass array of numbers
Mukesh KumarPosted Aug 31, 2017, 4:30 AM EDT
if you are creating the EXE like MyDemoApp.exe
class Program
{
static void Main(string[] args)
{
foreach (var arg in args)
{
Console.WriteLine(arg);
}
}
}
Command line like this:
MyDemoApp.exe agrument1 agrument2 agrument3
if you are not passing the string[] agrs then you can not paas the arguments in command line.
but Exe will run fine.
Anurag MauryaPosted Feb 9, 2017, 9:12 PM EST

