September 17, 2010 readf bug in the std.stdio | ||||
---|---|---|---|---|
| ||||
Code: import std.stdio; void main() { char a; wchar b; dchar c; readf("%s %s %s", &a,&b,&c); } Error : dmd -w -c "isimsiz.d" (C:\Program Files\Geany ) C:\D\dmd2\windows\bin\..\..\src\phobos\std\format.d(441): Error: template std.format.unformatValue(T,Range,Char) if (isArray!(T) && !isSomeString!(T)) does not match any function template declaration C:\D\dmd2\windows\bin\..\..\src\phobos\std\format.d(441): Error: template std.format.unformatValue(T,Range,Char) if (isArray!(T) && !isSomeString!(T)) cannot deduce template function from argument types !(char)(LockingTextReader,FormatSpec!(char)) C:\D\dmd2\windows\bin\..\..\src\phobos\std\format.d(441): Error: template instance errors instantiating template Is that intended, or a bug? Please note that this works: int i; readf("%s", &i); |
September 30, 2010 Re: readf bug in the std.stdio | ||||
---|---|---|---|---|
| ||||
Posted in reply to Can Alpay Çiftçi | 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;
...
|
Copyright © 1999-2021 by the D Language Foundation