Well if the program does nothing. What are all the lines for?
Actually the program does a lot of things, but these things are not visible.
The program has to initialize before it jumps right into your code, so you won't have to bother with the garbage collector and other "complicated stuff".
When the program is done initializing whatever it needs to initialize it executes the "main" function - and that is what you have written in "test.d".
This line says: This is the main function, it returns an "int" when called, and when you want to call it you have to give it a "char[[" which will be named "args". This is actually an array of char arrays - or an array of strings if you want to call it so. These strings are the arguments you called your program with. The resulting "int" of the function is the exit code of your program, it is commonly used to signal success or failure of the program (0 means success, not 0 means there was some kind of error). This return value can be usefull, e.g. in batch files or by other programs that execute your program.
This is the function body. The curly braces are there to group the commands together that belong to the function.
"return" is a keyword that means "exit the function here and return something" - and we want to return 0.
Each statement should be ended with a semicolon.
|