import std.stdio;
void main (char[][] args) {
if (args.length == 1)
args ~= "John Doe";
writefln("Hi %s! This is my very first program in D.", args[1]);
}
The program writes to the console some string depending on the first arguement given by the user. If null it is set to "John Doe". That is about it. Simple, but does the job. Compilation is extremely fast; it terminated even before I noticed it. After compilation, you get a native executable that runs on both Linux and Windows.
Cheers,
Boone
No comments:
Post a Comment