Question regarding readf
Andre Pany
andre at s-e-a-p.de
Mon Apr 22 20:45:54 UTC 2019
Hi,
following the example from http://ddili.org/ders/d.en/input.html,
I try to read a value from console on windows (powershell and dos
console).
The code from the example does not work,
writeln is never executed.
import std;
void main()
{
while(true)
{
string name;
readf("%s", name);
writeln(name);
}
}
also this doesn't work:
readf(" %s", name);
It only works while changing the line to:
readf("%s\n", name);
I wonder why the example from Ali is invalid. Did the behavior
changed in the past?
Kind regards
André
More information about the Digitalmars-d-learn
mailing list