Thread overview
writef / writefln and stderr
Jul 20, 2006
DYH
Jul 20, 2006
Oskar Linde
Jul 20, 2006
Derek Parnell
Jul 20, 2006
DYH
July 20, 2006
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?

DMD 0.163


July 20, 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
July 20, 2006
On Thu, 20 Jul 2006 23:30:26 +1000, DYH <DYH_member@pathlink.com> 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.

If you want to write to stderr, use this instead...

  import std.cstream;
  derr.writefln("test");


-- 
Derek Parnell
Melbourne, Australia
July 20, 2006
In article <e9o0hi$2inh$1@digitaldaemon.com>, DYH says...
>
>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?
>
>DMD 0.163
>
>

Ok guys, thanks for your replays =)