The difference in string and char[], readf() and scanf()

anonymous via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Mar 21 05:08:04 PDT 2015


On Saturday, 21 March 2015 at 08:37:59 UTC, Dennis Ritchie wrote:
> Tell me, please, why this code works correctly always:
[...]
> And this code works correctly is not always:
>
> import std.stdio;
>
> readf("%s\n", &n);
>
> char[200010] s, t;
> scanf("%s%s", s.ptr, t.ptr);

Please go into more detail about how it doesn't work.


More information about the Digitalmars-d-learn mailing list