Slicing to convert pointers to bound arrays

simendsjo simen.endsjo at pandavre.com
Sun Aug 8 14:41:02 PDT 2010


On 07.08.2010 16:48, bearophile wrote:
> simendsjo:
>> When I do the same with a static array, I get 0. But this is just
>> actually garbage, right? It might contain other data, and not always 0?
>
> Generally it contains "garbage".
> In string literals there is one more item that's empty (zero). I don't know if normal fixed-sized arrays too have the extra leading zero item (maybe yes), but relying on it is surely bad programming practice.
>
> Bye,
> bearophile

Ok, thanks. I expected this, but It's good to get it verified.


More information about the Digitalmars-d-learn mailing list