writef / writefln and stderr

Oskar Linde oskar.lindeREM at OVEgmail.com
Thu Jul 20 06:44:23 PDT 2006


DYH wrote:
> Consider this small sample:
> 
>> import std.stdio;
>>
>> int main(char[][] args)
>> {
>> 	writefln(stderr, "test");
>> 	return 0;
>> }
> 
> will output something like:
>>> 4164D0test
> 
> Is that correct behaviour?

Yes.

writef(ln) prints all of it's arguments to stdout. stdout is a 
std.c.stdio._iobuf*, i.e. a pointer. What you see is the pointer value 
being printed.

Try fwritef(ln) instead.

/Oskar



More information about the Digitalmars-d-bugs mailing list