Talk:D (programming language): Difference between revisions

Content deleted Content added
Line 21:
 
:::: Thanks, I've replaced the ''for'' example with the ''foreach'' one. By the way it looks like the new release now has writef() and writefln(), which could give ''writefln ("args[", i, "] = ", arg);'' instead of the printf in the example, but I haven't used it yet. [[User:SeeSchloss|→ SeeSchloß]] 21:30, 10 Jul 2004 (UTC)
==Example==
 
import std.stdio;
 
// D program to print 'hello world' followed by its command line arguments
int main(char[][] args)
{
writefln("hello world");
foreach (int i, char[] arg; args)
writefln("args[%d] = '%s'", i, arg);
return 0;
}
 
==The article reads like an advertisement for D==