6

This question already has an answer here:

Here is the function of my code where error comes

```

function getPeople() constant returns(bytes32[], bytes32[], uint[] ) {

uint length = people.length;

bytes32[] memory firstNames = new bytes32[](length);
bytes32[] memory lastNames = new bytes32[](length);
uint[] memory ages = new uint[](length);

for(uint i=0; i<people.length; i++) {
  Person memory currentPerson;
  currentPerson = people[i];

  firstNames.push(currentPerson.firstName);
  lastNames.push(currentPerson.lastName);
  ages.push(currentPerson.age);

}

```

Error is Member "push" is not available in bytes32[] memory outside of storage. firstNames.push(currentPerson.firstName);

marked as duplicate by Badr Bellaj, Rob Hitchens - B9lab, Herman Junge, user9402, niksmac Jun 21 '17 at 13:18

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    This is not the same question as the one indicated as duplicate. – aribo Sep 19 '18 at 18:43
  • Why was this marked as duplicate? the "duplicate" answer doesn't answer this question. – Miguel Mota Feb 9 at 11:27