On 26/12/2014 18:38, bearophile wrote:
In C# i would use something like:

int ThisNumber;
ThisNumber = Console.ReadLine();

in D it looks worse with its "old" way of doing it:

int thisNumber
readf("%s", &thisNumber);

Do you want to use a "%d"?

A more common way to do it in D is something like:

auto inLines = readln.byLine;
immutable thisNumber = inLines.front.to!int;
inLines.popFront;

Or just:
int thisNumber = readln().to!int;

Reply via email to