Thread overview | ||||||
---|---|---|---|---|---|---|
|
July 20, 2006 writef / writefln and stderr | ||||
---|---|---|---|---|
| ||||
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 Re: writef / writefln and stderr | ||||
---|---|---|---|---|
| ||||
Posted in reply to DYH | 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 Re: writef / writefln and stderr | ||||
---|---|---|---|---|
| ||||
Posted in reply to DYH | 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 Re: writef / writefln and stderr | ||||
---|---|---|---|---|
| ||||
Posted in reply to DYH | 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 =) |
Copyright © 1999-2021 by the D Language Foundation