Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Do Something

Part of TutorialFundamentals

Description

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

Example

import std.stdio;

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

Output

Prints "Hello" at the command line.

More Information

The write function is the standard way to send simple 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 write, it's variations and the std.stdio module can be found in the Phobos documentation.