February 21, 2006 writef format bug | ||||
---|---|---|---|---|
| ||||
At least I believe this is a bug. writefln("%c", 's'); gives me a format exception. |
February 21, 2006 Re: writef format bug | ||||
---|---|---|---|---|
| ||||
Posted in reply to nascent | On Mon, 20 Feb 2006 20:10:28 -0800, nascent wrote: > At least I believe this is a bug. > > writefln("%c", 's'); > > gives me a format exception. That is because '%c' is not a valid format specifier. See http://www.digitalmars.com/d/phobos/std_format.html for details. Use '%s' instead and it will format your character as a string. D's writefln is different to printf(). The format specifiers in D just tell D how you want it formatted, not what datatype you are supplying. It knows that already. -- Derek (skype: derek.j.parnell) Melbourne, Australia "Down with mediocracy!" 21/02/2006 3:32:16 PM |
Copyright © 1999-2021 by the D Language Foundation