Interviews5 answers
In C# If we do not pass string[] args array of string inside the Main() function which is the entry point of the application then what effect will be happen on application?
5 Answers
As far as you are not going to pass command line arguments, no need to write string[] args.
Sivasankar GorantlaPosted Sep 5, 2017, 12:53 AM EDT
no change on entry point and it's starts normally with Main method.
Siva DurgaprasadchPosted Jun 12, 2017, 10:50 PM EDT
No Effect.
1) The parameter of the Main method is a String array that represents the command-line arguments.
2) Command line arguments commonly get used when you need to pass information to your application at runtime.
3) For example if you were writing a program that copies a file from one location to another you would probably pass the two locations as command line arguments. For example:
4) Copy.exe C:\file1.txt C:\file2.txt
Sujeet SinghPosted Jun 1, 2017, 6:41 AM EDT
No Effects
Subhashkumar YadavPosted Feb 22, 2017, 1:24 AM EST
No, Effects on entry of point of your application
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:11 PM EST



