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

tcak via Digitalmars-d digitalmars-d at puremagic.com
Thu Mar 26 21:58:46 PDT 2015


On Friday, 27 March 2015 at 04:37:34 UTC, jonaspm wrote:
> Please, i need your help, I tried this:
>
> write("Write p: ");
> readln(p);
> p = chomp(p);
> writeln("Write q: ");
> readln(q);
> q = chomp(q);
>
> but the result is:
> Write p: Write q:
>
> and doesn't pause to read keyboard input... what's wrong?
>
> Thanks in advance!

http://dlang.org/phobos/std_stdio.html#.readln

Check the example, and you will see the problem. readln(p) 
doesn't read what was typed into p.


More information about the Digitalmars-d mailing list