I am trying to return nested array on solidity error massage says
"browser/HISTORYMultipleStateMach.sol:22:16: TypeError: Index expression cannot be omitted. return myArray[]; ^-------^" "browser/HISTORYMultipleStateMach.sol:22:16: TypeError: Index expression cannot be omitted. return myArray[]; ^-------^" Can someone tell me what is wrong? Thank you enum State{ A, B, C }
State[] curState;
State[][] myArray;
uint i=0;
constructor(uint Machines)public{
for(i=0;i<Machines;i++){
curState.push(State.A);
myArray.push(curState);
}enter code here
}
function historyOfStateMachine() public{
return myArray[];
}
function historyOfStateMachine() public{
return myArray[];
}
[]inreturn myArray[];Machinesin the outer scope (around where you declaremyArray) and then doreturn myArray[Machines]?