Dynamic / resizable array type, and a crash problem

Namespace via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu May 14 06:37:29 PDT 2015


On Thursday, 14 May 2015 at 13:26:27 UTC, ivoras wrote:
> On Thursday, 14 May 2015 at 12:46:48 UTC, Adam D. Ruppe wrote:
>> I would just use a regular `string[]` array...
>
> Is it resizable? Somehow I didn't get that impression from the 
> docs. Apparently it doesn't even have an "insert" method: 
> http://dlang.org/phobos/std_array.html .

----
string[] arr;
arr ~= "Foo";
arr ~= "Bar";

writeln(arr, ':', arr.length);
----

It's all built in. ;)

A nice article: http://dlang.org/d-array-article.html
and the language reference: http://dlang.org/arrays.html


More information about the Digitalmars-d-learn mailing list