+ 1
What's the point of args if it's optional?
Seen included when defining the main method. static void Main(string[ ] args) when static void Main( ) works just as fine?
1 Respuesta
+ 2
It is used when you are running your program with arguments. In CMD.
Example:
C:users/sysOP/Desktop> myprogram.exe "Hello"
static main(string[] args)
{
console. writeline(args[0])
// Would echo Hello
}
Mainly for parsing it stuff.