Re: Basic dynamic array question. Use of new versus no new.

2014-06-11 Thread Steven Schveighoffer via Digitalmars-d-learn
On Tue, 10 Jun 2014 23:28:16 -0400, Kapps wrote: On Wednesday, 11 June 2014 at 02:30:01 UTC, WhatMeWorry wrote: In Mr. Cehreli's book it says Additionally, the length of dynamic arrays can be changed by assigning a value to this property: int[] array; // initially empty array.length = 5;

Re: Basic dynamic array question. Use of new versus no new.

2014-06-11 Thread Jonathan M Davis via Digitalmars-d-learn
On Wed, 11 Jun 2014 02:30:00 + WhatMeWorry via Digitalmars-d-learn wrote: > In Mr. Cehreli's book it says > > Additionally, the length of dynamic arrays can be changed by > assigning a value to this property: > > int[] array; // initially empty > array.length = 5; // now has 5 elements > > wh

Re: Basic dynamic array question. Use of new versus no new.

2014-06-11 Thread monarch_dodra via Digitalmars-d-learn
On Wednesday, 11 June 2014 at 05:46:07 UTC, Ali Çehreli wrote: On 06/10/2014 08:06 PM, Matt wrote: > On Wednesday, 11 June 2014 at 02:30:01 UTC, WhatMeWorry wrote: >> int[] array; // initially empty >> array.length = 5; // now has 5 elements >> >> while in Mr. Alexandrescu's book, it says >> >>

Re: Basic dynamic array question. Use of new versus no new.

2014-06-10 Thread Ali Çehreli via Digitalmars-d-learn
On 06/10/2014 08:06 PM, Matt wrote: > On Wednesday, 11 June 2014 at 02:30:01 UTC, WhatMeWorry wrote: >> int[] array; // initially empty >> array.length = 5; // now has 5 elements >> >> while in Mr. Alexandrescu's book, it says >> >> To create a dynamic array, use a new expression (§ 2.3.6.1 on p

Re: Basic dynamic array question. Use of new versus no new.

2014-06-10 Thread Kapps via Digitalmars-d-learn
On Wednesday, 11 June 2014 at 02:30:01 UTC, WhatMeWorry wrote: In Mr. Cehreli's book it says Additionally, the length of dynamic arrays can be changed by assigning a value to this property: int[] array; // initially empty array.length = 5; // now has 5 elements while in Mr. Alexandrescu's bo

Re: Basic dynamic array question. Use of new versus no new.

2014-06-10 Thread Matt via Digitalmars-d-learn
On Wednesday, 11 June 2014 at 02:30:01 UTC, WhatMeWorry wrote: In Mr. Cehreli's book it says Additionally, the length of dynamic arrays can be changed by assigning a value to this property: int[] array; // initially empty array.length = 5; // now has 5 elements while in Mr. Alexandrescu's bo