4x faster strlen with 4 char sentinel

Mike Parker via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Mon Jun 27 16:56:42 PDT 2016


On Monday, 27 June 2016 at 19:51:48 UTC, Jay Norwood wrote:

> I also found it strange, the non-zero initialization values for 
> char, dchar, wchar.  I suppose there's some reason?
>
> int [100]  to zeros.
> char [100]  to 0xff;
> dchar [100]   to 0xffff;
> wchar [100]   to 0xffff;

The same reason float and double are default initialized to nan. 
char, wchar and dchar are default initialized to invalid unicode 
values.


More information about the Digitalmars-d-announce mailing list