readln() doesn't stop to read the input.

via Digitalmars-d digitalmars-d at puremagic.com
Sat Mar 28 05:50:22 PDT 2015


You can clear the input stream:

> while(getchar() != '\n') {};

Or just use readln:

> int resp = readln.chomp.to!int;



More information about the Digitalmars-d mailing list