On 16-05-2012 22:42, Steven Schveighoffer wrote:
On Wed, 16 May 2012 16:19:36 -0400, Alex Rønne Petersen <[email protected]>
wrote:

Theoretically, yes, practically, not really.

void myLog(string msg)
{
printf(msg);
}

Wait, this should be an error. You need toStringz there.

-Steve

Sorry, I meant:

void myLog(string msg)
{
    printf(msg.ptr);
}

(Which works as expected because string literals are null-terminated. This is also how things work when you pass a string literal to a const(char)* value; it just does "literal".ptr.)

--
Alex Rønne Petersen
[email protected]
http://lycus.org

Reply via email to