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

Get input from the user (uses readln)

Part of TutorialFundamentals

Description

Shows how you can ask the user for input during runtime.

Example

import std.stdio;

void main()
{
	writefln("What is your name?");
	
	string name = readln();
	
	writefln("Hello ", name);
}