Converting literal strings to pointers

John Kiro johnkirollos at yahoo.com
Tue Jan 9 14:31:06 PST 2007


== Quote from novice2 (sorry at noem.ail)'s article
> sorry, may be i missing something, but imho
> cast(void*)"str".ptr is too redundant.
> for me this work:
> import std.stdio;
> void main()
> {
>   void* p = "str".ptr;
>   writefln("p=%08X", p);
> }

YES.. It works perfectly! thanks for saving me some extra characters
to type, beside of course the added code clarity ;-)

John


More information about the Digitalmars-d-learn mailing list