readf bug in the std.stdio

Ivan Melnychuk ivan.melnychuk+news at gmail.com
Thu Sep 30 13:17:59 PDT 2010


On 17.09.2010 22:28, Can Alpay Çiftçi wrote:
> Code:
> import std.stdio;
>
> void main() {
>
>      char a;
>      wchar b;
>      dchar c;
>
>      readf("%s %s %s",&a,&b,&c);
>
> }

The strings (char arrays) are handled specially, therefore the [w|d]char 
arrays cannot be read. But are you sure you need to read chars and not 
strings (char arrays)? The following will work fine:

...
     char[] a;
     wchar[] b;
     dchar[] c;
...


More information about the Digitalmars-d-learn mailing list