why is there "string[] args" inside the main function parentheses?
Hello, I've just started learning c# (after doing some c++) and I wonder why it's like that since we don't even use it inside the main function, like it's just there and I'd like to know why
8 Replies
its just the default signature template of Main used when u create a console project, you can also make it Main()
its optional, you dont have to put it
you can use it, it's the same as argc/argv in c++
it contains the arguments used to run the program
if you run in cmd
the first element in the array would be "hello"
and the 2nd element in the array would be "world"
the first argument is the full path to the executable, no?
Ok thanks guys, I get it now
No i dont think so
not in c# atleast
seems like you're right