Thread overview | |||||
---|---|---|---|---|---|
|
April 04, 2020 Simple array problem | ||||
---|---|---|---|---|
| ||||
Hi. I am very new to D Language and I apologize for my bad question. Why the followin code gives me the error? Error: only one index allowed to index `int[3][3]` import std.stdio; import std.array; void main() { int[3][3] matrix; matrix[2,2]=99; } Thank you very much GIovanni |
April 04, 2020 Re: Simple array problem | ||||
---|---|---|---|---|
| ||||
Posted in reply to Giovanni Di Maria | On Saturday, 4 April 2020 at 09:09:44 UTC, Giovanni Di Maria wrote:
> Why the followin code gives me the error?
>
> Error: only one index allowed to index `int[3][3]`
Use matrix[2][2] instead of matrix[2,2].
|
April 04, 2020 Re: Simple array problem | ||||
---|---|---|---|---|
| ||||
Posted in reply to MoonlightSentinel | On Saturday, 4 April 2020 at 10:57:36 UTC, MoonlightSentinel wrote:
> On Saturday, 4 April 2020 at 09:09:44 UTC, Giovanni Di Maria wrote:
>> Why the followin code gives me the error?
>>
>> Error: only one index allowed to index `int[3][3]`
>
> Use matrix[2][2] instead of matrix[2,2].
OK.
Thank you very MUCH
Giovanni
|
Copyright © 1999-2021 by the D Language Foundation