Re: variable x cannot be read at compile time - how to get around this?

2014-11-13 Thread Sergey via Digitalmars-d
On Thursday, 13 November 2014 at 14:27:32 UTC, Steven Schveighoffer wrote: On 11/13/14 2:08 AM, Sergey wrote: Hello everyone! I need to create a two-dimensional array in this way, for example: auto x = 10; auto y = 10; auto some_array = new string[x][y]; auto some_array = new string[][](

Re: variable x cannot be read at compile time - how to get around this?

2014-11-13 Thread Steven Schveighoffer via Digitalmars-d
On 11/13/14 2:08 AM, Sergey wrote: Hello everyone! I need to create a two-dimensional array in this way, for example: auto x = 10; auto y = 10; auto some_array = new string[x][y]; auto some_array = new string[][](x, y); Note, this creates 10 arrays of 10 elements all on the heap, and then

Re: variable x cannot be read at compile time - how to get around this?

2014-11-13 Thread Brian Schott via Digitalmars-d
On Thursday, 13 November 2014 at 07:08:19 UTC, Sergey wrote: Hello everyone! I need to create a two-dimensional array in this way, for example: What did you want the type of the array to be? "string[10][10]" or "string[][]"?

Re: variable x cannot be read at compile time - how to get around this?

2014-11-13 Thread ketmar via Digitalmars-d
On Thu, 13 Nov 2014 07:08:17 + Sergey via Digitalmars-d wrote: >Hello everyone! > > I need to create a two-dimensional array in this way, for example: > > auto x = 10; > auto y = 10; > auto some_array = new string[x][y]; > variable x cannot be read at compile time > > I tried this: > e

Re: variable x cannot be read at compile time - how to get around this?

2014-11-13 Thread Sergey via Digitalmars-d
On Thursday, 13 November 2014 at 07:50:26 UTC, Brian Schott wrote: On Thursday, 13 November 2014 at 07:08:19 UTC, Sergey wrote: Hello everyone! I need to create a two-dimensional array in this way, for example: What did you want the type of the array to be? "string[10][10]" or "string[][]"

variable x cannot be read at compile time - how to get around this?

2014-11-12 Thread Sergey via Digitalmars-d
Hello everyone! I need to create a two-dimensional array in this way, for example: auto x = 10; auto y = 10; auto some_array = new string[x][y]; variable x cannot be read at compile time I tried this: enum columns_array = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]; auto y = 10; in