import std.stdio; void main(){ int n; while(readf("%d", &n)){ if(n == 11) break; writeln(n); } }
The first iteration works, and it prints n , but after that readf() never returns.
There is only one line in the documentation explaining readf() :
uint readf (A ...) (in char [] format, A args);
Formatted read one line from stdin.
Am I something wrong? or is something wrong with readf() ? I just need to read numbers from standard input.
using: DMD 2.054 64-bit
source share