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.

1 Answer 1


I suggest you change the way you built your uint256[13] to use uint256[] memory _value = new uint256[](13); instead. Then you should be able to use myFunc(_value).

If your array does not always contain 13 elements, you can replace 13 with a variable, like so:

uint256 _n = 3;
uint256[] memory _value = new uint256[](_n);
// populate your array

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.