Idea: Introduce zero-terminated string specifier

Jakob Ovrum jakobovrum at gmail.com
Mon Oct 1 02:23:31 PDT 2012


On Monday, 1 October 2012 at 09:17:52 UTC, Piotr Szturmaj wrote:
> Adam D. Ruppe wrote:
>> On Saturday, 29 September 2012 at 02:11:12 UTC, Alex Rønne 
>> Petersen wrote:
>> Also this reminds me of the utter uselessness of the current 
>> behavior of
>> "%s" and a pointer - it prints the address.
>
> Why not specialize current "%s" for character pointer types so 
> it will print null terminated strings? It's always possible to 
> cast to void* to print an address.

It's not safe to assume that pointers to characters are generally 
null terminated.



More information about the Digitalmars-d mailing list