Initializing static arrays without specifying size
Philippe Sigaud
philippe.sigaud at gmail.com
Mon Aug 2 11:44:44 PDT 2010
On Mon, Aug 2, 2010 at 14:15, bearophile <bearophileHUGS at lycos.com> wrote:
>
> That's one solution, but code like that is most useful when your arrays
> liters are long (because if they are little you can just count the items and
> avoid using staticArray)
Yes, but as Ziad said:
"If I want a static array (...) I'd have to specify the size in advance (5
in this case), which
means that adding extra elements later on would require that the size be
update."
So small-size arrays _are_ a possibility.
Ziad:
> Thanks for your feedback Philippe and bearophile :)
If you understand the code, very well. If not, say so. I know I'd have been
unable to understand it two years ago.
Philippe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20100802/4f7f1dcf/attachment.html>
More information about the Digitalmars-d-learn
mailing list