I want to initialise a two-dimensional dynamic array. For a one-dimensional array it looks like that:

function verify(uint[50] memory input){
uint[] memory input_values = new uint[](input.length);
        for(uint i = 0; i < input.length; i++){
            input_values[i] = input[i];

How would that code look like for a two dimensional array:

function verify(uint[50][2] memory input) {

uint[][] memory input_values = ??


Thank you and enjoy your day!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.