Gary Willoughby:

I've noticed that const(char)** can be accessed via indexes:

writefln("%s", pp[0].to!(string)); //etc.

cool!

This is a feature that works with all pointers to a sequence of items, like in C. But array bounds are not verified, so it's more bug-prone. So if you know the length it's better to slice the pointer as soon as possible, and then use the slice:

auto ap = pp[0 .. N];
writefln("%s", ap[0].text);

Or just:

printf("%s\n", ap[0]);

Bye,
bearophile

Reply via email to