A writefln issue or a Thread issue?

div0 div0 at users.sourceforge.net
Sat Sep 5 04:14:34 PDT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sam Hu wrote:
> Fyi:
> 1.with DMD2032 under windows xp;
> 2.Tried printf,write,writeln,writef,writefln but all the same result:blank DOS console under current exe path;
> 3.In c/c++ it opens total 2 DOS windows which works properly: the main one and the one created by CREATE_NEW_CONSOLE ;but in D it opens total 3 DOS consoles,the main one and 2 blank consoles which were created by CREATE_NEW_CONSOLE,both under current exe path.


writefln("%s\n",toStringz(startupProcess)); // prints blank!!!
	
the toStringz in the writefln is wrong.
You've already returned a string from startupProcess.

The toStringz returns a char* which writefln is printing
as a pointer, so you are seeing something like '974f40' being printed
instead of the message you where expecting.

- --
My enormous talent is exceeded only by my outrageous laziness.
http://www.ssTk.co.uk
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFKokgaT9LetA9XoXwRArHUAJ4yTRoDqyrPlcCk5cdCZ7Yw2+iTSACg0u9w
3tpmYa8ftFEVErLMInIkb1k=
=RgrL
-----END PGP SIGNATURE-----


More information about the Digitalmars-d-learn mailing list