[Issue 6555] New: Problem with readf
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Aug 25 02:53:22 PDT 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6555
Summary: Problem with readf
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2011-08-25 02:53:20 PDT ---
import std.stdio: readf, writef, writeln;
void main() {
int x = 5;
writef("Give x: ");
readf("%d\n", &x);
writeln("\nx: ", x);
}
If there is no input (because that program is called by another one), readf
leaves x unchanged and doesn't raise an exception. I think this is not good.
-------------
Another problem: on Windows if you run that program from the console, and you
just hit enter, you are allowed to keep giving lines. Is this by design?
...>test
Give x:
555
123
155
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list