string-int[] array

Paul via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Mar 8 14:11:42 PDT 2015


On Sunday, 8 March 2015 at 18:05:33 UTC, Dennis Ritchie wrote:
> Is it possible to create such an array in which you can store 
> strings and numbers at the same time?
>
> string-int[] array = [4, "five"];

As there's no mention of performance, what's wrong with a plain 
old string array with a bit of conversion and error checking?

string[] soup = ["4", "Test", "5", "More Test"];


More information about the Digitalmars-d-learn mailing list