Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.
Version 2 (modified by csauls, 18 years ago)
Updated to use writef.

Do Something

Part of TutorialFundamentals

Description

It's an abbreviated "hello world" without the world.

Example

import std.stdio;

void main()
{ 
    writef("Hello");
}

Output

Prints "Hello" at the command line.

More Information

The writef function is the standard way to send simple or formatted text to the console. In this example, the quoted phrase is simply printed as-is. The import statement will include symbols from the std.stdio module. Luckily, all modules in the std package are part of the standard library and are automatically linked by the compiler, so you don't have to include them in your command line.

More information on writef and the std.stdio module can be found at the Phobos documentation.

Source

Posted by csauls
Date/Time Mon Jan 02, 2006 03:52 am