+ 2
Why we use [ ]
pls explain it static void SayHi() { Console.WriteLine("Hello"); } static void Main(string[] args) //??? { SayHi(); SayHi(); SayHi(); }
2 Answers
+ 22
This array (args) contains the initial parameters passed from your compiler to the code upon run... Your IDE has an option to run code with specific params... Can also be blank...
+ 1
In addition to ValentinHacker.
[ ] stands for array. So the arguments that are given to the application are given in a array of string named args.
args[0] will give you the first element.