1

Below is the code that I have:

struct Cow{
    uint age;
    uint name;
}

Cow[] cows;

// this is the code I am trying below.
function createCows(Cow[] memory _cows) public {
    cows =_cows;
}

When I try the code above I get an error:

UnimplementedFeatureError: Copying of type struct Test.Cow memory[] memory to storage not yet supported.

Is it possible to achieve what I am trying to achieve without using a loop?

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.