Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Accessing public array element with indices. #285

Open
sjana0 opened this issue Oct 16, 2019 · 0 comments
Open

Accessing public array element with indices. #285

sjana0 opened this issue Oct 16, 2019 · 0 comments

Comments

@sjana0
Copy link
Collaborator

sjana0 commented Oct 16, 2019

Describe the bug
With indices I tried to access elements of a 2D array declared with public keyword. But on taking the index inputs is shows a type error.

To Reproduce
Steps to reproduce the behavior:

uint[3][3] public fixedSized;
constructor () public {
      uint j;
      for (uint i=0;i<3;i++){
          j = i+1;
          fixedSized[i] = [j*1, j*2, j*3];
      }
    }

Expected behavior
The array should output the element at the particular location according to the indices.

Screenshots
image

Desktop (please complete the following information):

  • OS: Linux
  • Atom IDE
  • Version 0.4.5
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant