Basically, I want to call a function myfunct(uint256[] memory)
but I have a uint256[13]
I have the uint256[13] because I want to temporarily store uint256s in a function, and save memory–not do storage.
arraysdata-typesmemorysolidityuint256
Basically, I want to call a function myfunct(uint256[] memory)
but I have a uint256[13]
I have the uint256[13] because I want to temporarily store uint256s in a function, and save memory–not do storage.
Best Answer
I suggest you change the way you built your
uint256[13]
to useuint256[] memory _value = new uint256[](13);
instead. Then you should be able to usemyFunc(_value)
.If your array does not always contain 13 elements, you can replace
13
with a variable, like so: