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

FG via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Mar 21 12:09:56 PDT 2015


On 2015-03-21 at 16:05, Ivan Kazmenko wrote:
> Generate a 100000-character string
>[...]
> Try to copy it with D scanf and printf:
> -----
> import std.stdio;
> void main () {
>      char [100000] a;
>      scanf ("%s", a.ptr);
>      printf ("%s\n", a.ptr);
> }
> -----
>
> Only 32767 first characters of the string are actually copied.

In what universe?! Which OS, compiler and architecture?


More information about the Digitalmars-d-learn mailing list